forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'microsoft:main' into main
- Loading branch information
Showing
1,880 changed files
with
44,696 additions
and
23,289 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* 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 { TSESTree } from '@typescript-eslint/experimental-utils'; | ||
|
||
/** | ||
* WORKAROUND for https://github.com/evanw/esbuild/issues/3823 | ||
*/ | ||
export = new class implements eslint.Rule.RuleModule { | ||
|
||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { | ||
|
||
function checkProperty(inNode: any) { | ||
|
||
const classDeclaration = context.getAncestors().find(node => node.type === 'ClassDeclaration'); | ||
const propertyDefinition = <TSESTree.PropertyDefinition>inNode; | ||
|
||
if (!classDeclaration || !classDeclaration.id?.name) { | ||
return; | ||
} | ||
|
||
if (!propertyDefinition.value) { | ||
return; | ||
} | ||
|
||
const classCtor = classDeclaration.body.body.find(node => node.type === 'MethodDefinition' && node.kind === 'constructor') | ||
|
||
if (!classCtor) { | ||
return; | ||
} | ||
|
||
const name = classDeclaration.id.name; | ||
const valueText = context.getSourceCode().getText(<any>propertyDefinition.value) | ||
|
||
if (valueText.includes(name + '.')) { | ||
|
||
if (classCtor.value?.type === 'FunctionExpression' && !classCtor.value.params.find((param: any) => param.type === 'TSParameterProperty' && param.decorators?.length > 0)) { | ||
return | ||
} | ||
|
||
context.report({ | ||
loc: propertyDefinition.value.loc, | ||
message: `Static properties in decorated classes should not reference the class they are defined in. Use 'this' instead. This is a workaround for https://github.com/evanw/esbuild/issues/3823.` | ||
}); | ||
} | ||
|
||
} | ||
|
||
return { | ||
'PropertyDefinition[static=true]': checkProperty, | ||
}; | ||
} | ||
}; |
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
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,22 @@ | ||
name: On Reopen | ||
on: | ||
issues: | ||
types: [reopened] | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Actions | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: "microsoft/vscode-github-triage-actions" | ||
ref: stable | ||
path: ./actions | ||
- name: Install Actions | ||
run: npm install --production --prefix ./actions | ||
|
||
- name: Check for Validity | ||
uses: ./actions/validity-checker | ||
with: | ||
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} |
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 +1 @@ | ||
20.12.1 | ||
20.14.0 |
Oops, something went wrong.