Skip to content

Commit 6db3ecf

Browse files
committed
chore: update eslint config and quiet lint output
- Add recommended TypeScript ESLint rules and configurations - Configure explicit function return types and member accessibility - Add environment settings for Node.js and ES2021 - Update parser options and ignore patterns - Add --quiet flag to lint commands to reduce noise
1 parent 477daf8 commit 6db3ecf

File tree

3 files changed

+44
-12
lines changed

3 files changed

+44
-12
lines changed

.eslintrc.json

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,56 @@
11
{
22
"root": true,
3+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
34
"parser": "@typescript-eslint/parser",
45
"parserOptions": {
5-
"ecmaVersion": 6,
6-
"sourceType": "module"
6+
"ecmaVersion": 2021,
7+
"sourceType": "module",
8+
"project": "./tsconfig.json"
79
},
810
"plugins": ["@typescript-eslint"],
911
"rules": {
10-
"@typescript-eslint/naming-convention": [
12+
"@typescript-eslint/naming-convention": ["warn"],
13+
"@typescript-eslint/no-explicit-any": "off",
14+
"@typescript-eslint/no-unused-vars": [
1115
"warn",
1216
{
13-
"selector": "import",
14-
"format": ["camelCase", "PascalCase"]
17+
"argsIgnorePattern": "^_",
18+
"varsIgnorePattern": "^_",
19+
"caughtErrorsIgnorePattern": "^_"
1520
}
1621
],
17-
"@typescript-eslint/semi": "off",
18-
"eqeqeq": "warn",
22+
"@typescript-eslint/explicit-function-return-type": [
23+
"warn",
24+
{
25+
"allowExpressions": true,
26+
"allowTypedFunctionExpressions": true
27+
}
28+
],
29+
"@typescript-eslint/explicit-member-accessibility": [
30+
"warn",
31+
{
32+
"accessibility": "explicit"
33+
}
34+
],
35+
"@typescript-eslint/no-non-null-assertion": "warn",
1936
"no-throw-literal": "warn",
20-
"semi": "off",
21-
"react-hooks/exhaustive-deps": "off"
37+
"semi": ["off", "always"],
38+
"quotes": ["warn", "double", { "avoidEscape": true }],
39+
"@typescript-eslint/ban-types": "off",
40+
"@typescript-eslint/no-var-requires": "warn",
41+
"no-extra-semi": "warn",
42+
"prefer-const": "warn",
43+
"no-mixed-spaces-and-tabs": "warn",
44+
"no-case-declarations": "warn",
45+
"no-useless-escape": "warn",
46+
"require-yield": "warn",
47+
"no-empty": "warn",
48+
"no-control-regex": "warn",
49+
"@typescript-eslint/ban-ts-comment": "warn"
50+
},
51+
"env": {
52+
"node": true,
53+
"es2021": true
2254
},
23-
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
55+
"ignorePatterns": ["dist/**", "out/**", "webview-ui/**", "**/*.js"]
2456
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
"compile": "npm run check-types && npm run lint && node esbuild.js",
213213
"compile-tests": "tsc -p . --outDir out",
214214
"install:all": "npm install && cd webview-ui && npm install",
215-
"lint": "eslint src --ext ts && npm run lint --prefix webview-ui",
215+
"lint": "eslint src --ext ts --quiet && npm run lint --prefix webview-ui",
216216
"package": "npm run build:webview && npm run check-types && npm run lint && node esbuild.js --production",
217217
"pretest": "npm run compile-tests && npm run compile && npm run lint",
218218
"start:webview": "cd webview-ui && npm run start",

webview-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "tsc && vite build",
99
"preview": "vite preview",
1010
"test": "jest",
11-
"lint": "eslint src --ext ts,tsx"
11+
"lint": "eslint src --ext ts,tsx --quiet"
1212
},
1313
"dependencies": {
1414
"@vscode/webview-ui-toolkit": "^1.4.0",

0 commit comments

Comments
 (0)