-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge upstream 1.95 into Positron (#5678)
Merges upstream changes from vscode-server and VS Code 1.95 into Positron. --------- Co-authored-by: positron-bot[bot] <173392469+positron-bot[bot]@users.noreply.github.com> Co-authored-by: Brian Lambert <[email protected]>
- Loading branch information
1 parent
b63cb63
commit 476ac29
Showing
5,723 changed files
with
241,610 additions
and
153,669 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
|
||
yarn install --network-timeout 180000 | ||
yarn electron | ||
npm i | ||
npm run electron |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import * as eslint from 'eslint'; | ||
import { dirname, relative } from 'path'; | ||
import minimatch from 'minimatch'; | ||
|
||
export = new class implements eslint.Rule.RuleModule { | ||
|
||
readonly meta: eslint.Rule.RuleMetaData = { | ||
messages: { | ||
layerbreaker: 'You are only allowed to define limited top level functions.' | ||
}, | ||
schema: { | ||
type: "array", | ||
items: { | ||
type: "object", | ||
additionalProperties: { | ||
type: "array", | ||
items: { | ||
type: "string" | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { | ||
let fileRelativePath = relative(dirname(__dirname), context.getFilename()); | ||
if (!fileRelativePath.endsWith('/')) { | ||
fileRelativePath += '/'; | ||
} | ||
const ruleArgs = <Record<string, string[]>>context.options[0]; | ||
|
||
const matchingKey = Object.keys(ruleArgs).find(key => fileRelativePath.startsWith(key) || minimatch(fileRelativePath, key)); | ||
if (!matchingKey) { | ||
// nothing | ||
return {}; | ||
} | ||
|
||
const restrictedFunctions = ruleArgs[matchingKey]; | ||
|
||
return { | ||
FunctionDeclaration: (node: any) => { | ||
const isTopLevel = node.parent.type === 'Program'; | ||
const functionName = node.id.name; | ||
if (isTopLevel && !restrictedFunctions.includes(node.id.name)) { | ||
context.report({ | ||
node, | ||
message: `Top-level function '${functionName}' is restricted in this file. Allowed functions are: ${restrictedFunctions.join(', ')}.` | ||
}); | ||
} | ||
}, | ||
ExportNamedDeclaration(node: any) { | ||
if (node.declaration && node.declaration.type === 'FunctionDeclaration') { | ||
const functionName = node.declaration.id.name; | ||
const isTopLevel = node.parent.type === 'Program'; | ||
if (isTopLevel && !restrictedFunctions.includes(node.declaration.id.name)) { | ||
context.report({ | ||
node, | ||
message: `Top-level function '${functionName}' is restricted in this file. Allowed functions are: ${restrictedFunctions.join(', ')}.` | ||
}); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.