Skip to content

Commit 5f491e6

Browse files
vicperdanaCopilot
andcommitted
fix: migrate VS Code extension to ESLint 9 flat config
ESLint ^9.x dropped support for .eslintrc.json and the --ext flag. npm run lint would fail on CI. - Create eslint.config.mjs (flat config format) - Add typescript-eslint and @eslint/js dependencies - Update lint script: remove --ext ts flag - Delete legacy .eslintrc.json Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8abd56b commit 5f491e6

3 files changed

Lines changed: 24 additions & 26 deletions

File tree

packages/vscode-extension/.eslintrc.json

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// @ts-check
2+
import eslint from "@eslint/js";
3+
import tseslint from "typescript-eslint";
4+
5+
export default tseslint.config(
6+
eslint.configs.recommended,
7+
...tseslint.configs.recommended,
8+
{
9+
files: ["src/**/*.ts"],
10+
rules: {
11+
"@typescript-eslint/naming-convention": "warn",
12+
"curly": "warn",
13+
"eqeqeq": "warn",
14+
"no-throw-literal": "warn",
15+
},
16+
},
17+
{
18+
ignores: ["out/", "dist/", "**/*.d.ts"],
19+
}
20+
);

packages/vscode-extension/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"compile": "tsc -p ./",
6161
"watch": "tsc -watch -p ./",
6262
"pretest": "npm run compile",
63-
"lint": "eslint src --ext ts",
63+
"lint": "eslint src",
6464
"test": "node ./out/test/runTest.js",
6565
"pack": "vsce package",
6666
"publish": "vsce publish",
@@ -85,7 +85,9 @@
8585
"glob": "^11.1.0",
8686
"mocha": "^11.1.0",
8787
"typescript": "^5.4.5",
88-
"vscode-test": "^1.6.1"
88+
"vscode-test": "^1.6.1",
89+
"typescript-eslint": "^8.45.0",
90+
"@eslint/js": "^9.28.0"
8991
},
9092
"dependencies": {
9193
"@vscode/vsce": "^3.3.2"

0 commit comments

Comments
 (0)