Skip to content

Commit 4812b7e

Browse files
authored
update eslint (microsoft#489)
* eslint migration * update eslint for JavaScript
1 parent 793b423 commit 4812b7e

31 files changed

+573
-1021
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

generators/app/dependencyVersions/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
"@types/mocha": "^10.0.7",
88
"@types/node": "20.x",
99
"@types/assert": "^1.5.10",
10-
"@typescript-eslint/eslint-plugin": "^7.14.1",
11-
"@typescript-eslint/parser": "^7.11.0",
12-
"eslint": "^8.57.0",
13-
"glob": "^10.4.2",
14-
"mocha": "^10.5.2",
15-
"typescript": "^5.4.5",
16-
"@vscode/test-cli": "^0.0.9",
17-
"@vscode/test-electron": "^2.4.0",
18-
"@vscode/test-web": "^0.0.55",
10+
"@typescript-eslint/eslint-plugin": "^8.3.0",
11+
"@typescript-eslint/parser": "^8.3.0",
12+
"eslint": "^9.9.1",
13+
"glob": "^11.0.0",
14+
"mocha": "^10.7.3",
15+
"typescript": "^5.5.4",
16+
"@vscode/test-cli": "^0.0.10",
17+
"@vscode/test-electron": "^2.4.1",
18+
"@vscode/test-web": "^0.0.57",
1919
"@types/webpack-env": "^1.18.5",
2020
"@types/vscode-notebook-renderer": "^1.72.3",
2121
"concurrently": "^8.2.2",
@@ -25,14 +25,14 @@
2525
"ts-loader": "^9.5.1",
2626
"vscode-dts": "^0.3.3",
2727
"vscode-notebook-error-overlay": "^1.0.1",
28-
"webpack": "^5.92.1",
28+
"webpack": "^5.94.0",
2929
"util": "^0.12.5",
3030
"webpack-cli": "^5.1.4",
3131
"webpack-dev-server": "^5.0.4",
3232
"assert": "^2.1.0",
3333
"process": "^0.11.10",
3434
"npm-run-all": "^4.1.5",
35-
"esbuild": "^0.21.5",
35+
"esbuild": "^0.23.1",
3636
"@esbuild-plugins/node-globals-polyfill": "^0.2.3"
3737
}
3838
}

generators/app/generate-command-js.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default {
6363
generator.fs.copyTpl(generator.templatePath('extension.js'), generator.destinationPath('extension.js'), extensionConfig);
6464
generator.fs.copyTpl(generator.templatePath('package.json'), generator.destinationPath('package.json'), extensionConfig);
6565
generator.fs.copy(generator.templatePath('.vscode-test.mjs'), generator.destinationPath('.vscode-test.mjs'));
66-
generator.fs.copyTpl(generator.templatePath('.eslintrc.json'), generator.destinationPath('.eslintrc.json'), extensionConfig);
66+
generator.fs.copyTpl(generator.templatePath('eslint.config.mjs'), generator.destinationPath('eslint.config.mjs'), extensionConfig);
6767

6868
if (extensionConfig.pkgManager === 'yarn') {
6969
generator.fs.copyTpl(generator.templatePath('.yarnrc'), generator.destinationPath('.yarnrc'), extensionConfig);

generators/app/generate-command-ts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default {
6464
generator.fs.copyTpl(generator.templatePath('src/extension.ts'), generator.destinationPath('src/extension.ts'), extensionConfig);
6565
generator.fs.copy(generator.templatePath('src/test'), generator.destinationPath('src/test'));
6666
generator.fs.copy(generator.templatePath('.vscode-test.mjs'), generator.destinationPath('.vscode-test.mjs'));
67-
generator.fs.copy(generator.templatePath('.eslintrc.json'), generator.destinationPath('.eslintrc.json'));
67+
generator.fs.copy(generator.templatePath('eslint.config.mjs'), generator.destinationPath('eslint.config.mjs'));
6868

6969
if (extensionConfig.pkgManager === 'yarn') {
7070
generator.fs.copyTpl(generator.templatePath('.yarnrc'), generator.destinationPath('.yarnrc'), extensionConfig);

generators/app/generate-command-web.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default {
6565
generator.fs.copy(generator.templatePath('src/web/test/suite/webpack-mochaTestRunner.ts'), generator.destinationPath('src/web/test/suite/index.ts'));
6666
}
6767

68-
generator.fs.copy(generator.templatePath('.eslintrc.json'), generator.destinationPath('.eslintrc.json'));
68+
generator.fs.copy(generator.templatePath('eslint.config.mjs'), generator.destinationPath('eslint.config.mjs'));
6969

7070
if (extensionConfig.pkgManager === 'yarn') {
7171
generator.fs.copyTpl(generator.templatePath('.yarnrc'), generator.destinationPath('.yarnrc'), extensionConfig);

generators/app/generate-notebook-renderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default {
4141
generator.fs.copy(generator.templatePath('tsconfig.json'), generator.destinationPath('tsconfig.json'));
4242
generator.fs.copy(generator.templatePath('.vscodeignore'), generator.destinationPath('.vscodeignore'));
4343
generator.fs.copy(generator.templatePath('webpack.config.js'), generator.destinationPath('webpack.config.js'));
44-
generator.fs.copy(generator.templatePath('.eslintrc.json'), generator.destinationPath('.eslintrc.json'));
44+
generator.fs.copy(generator.templatePath('eslint.config.mjs'), generator.destinationPath('eslint.config.mjs'));
4545
generator.fs.copy(generator.templatePath('.vscode-test.mjs'), generator.destinationPath('.vscode-test.mjs'));
4646

4747
generator.fs.copyTpl(generator.templatePath('package.json'), generator.destinationPath('package.json'), extensionConfig);

generators/app/templates/ext-command-js/.eslintrc.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

generators/app/templates/ext-command-js/.vscodeignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ test/**
66
vsc-extension-quickstart.md
77
**/jsconfig.json
88
**/*.map
9-
**/.eslintrc.json
9+
**/eslint.config.mjs
1010
**/.vscode-test.*
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import globals from "globals";
2+
3+
export default [{
4+
files: ["**/*.js"],
5+
languageOptions: {
6+
globals: {
7+
...globals.commonjs,
8+
...globals.node,
9+
...globals.mocha,
10+
},
11+
12+
ecmaVersion: 2022,
13+
sourceType: "module",
14+
},
15+
16+
rules: {
17+
"no-const-assign": "warn",
18+
"no-this-before-super": "warn",
19+
"no-undef": "warn",
20+
"no-unreachable": "warn",
21+
"no-unused-vars": "warn",
22+
"constructor-super": "warn",
23+
"valid-typeof": "warn",
24+
},
25+
}];

0 commit comments

Comments
 (0)