Skip to content

Commit 5648ad2

Browse files
committed
Update ESLint to new rules and presets
1 parent d6fda9d commit 5648ad2

7 files changed

+72
-39
lines changed

.eslintignore

-5
This file was deleted.

.eslintrc.yml

-30
This file was deleted.

.prettierrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
singleQuote: true
2-
trailingComma: none
2+
trailingComma: es5
33
arrowParens: avoid
44
semi: false
55
tabWidth: 2

.vscode/settings.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@
1414
"mochaExplorer.env": {
1515
"VSCODE_VERSION": "insiders",
1616
"ELECTRON_RUN_AS_NODE": null
17-
}
17+
},
18+
"eslint.useFlatConfig": true,
19+
"eslint.useESLintClass": true
1820
}

eslint.config.mjs

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import eslint from '@eslint/js'
2+
import tseslint from 'typescript-eslint'
3+
import globals from 'globals'
4+
5+
export default tseslint.config(
6+
eslint.configs.recommended,
7+
...tseslint.configs.recommendedTypeChecked,
8+
...tseslint.configs.stylisticTypeChecked,
9+
{
10+
ignores: [
11+
'.vscode-test/**',
12+
'dist/**',
13+
'eslint.config.mjs',
14+
'vscode.d.ts',
15+
'vscode.proposed.d.ts',
16+
'.vscode-test.js',
17+
'*.config.js',
18+
],
19+
},
20+
{
21+
languageOptions: {
22+
globals: {
23+
...globals.node,
24+
},
25+
parser: tseslint.parser,
26+
ecmaVersion: 2023,
27+
parserOptions: {
28+
// project: './tsconfig.json',
29+
projectService: true,
30+
tsconfigRootDir: import.meta.dirname,
31+
},
32+
},
33+
rules: {
34+
'@typescript-eslint/no-unsafe-member-access': 'off', //FIXME: Implement
35+
'@typescript-eslint/no-unsafe-assignment': 'off', //FIXME: Implement
36+
'@typescript-eslint/no-unsafe-argument': 'off', //FIXME: Implement
37+
'@typescript-eslint/no-unsafe-call': 'off', //FIXME: Implement
38+
'@typescript-eslint/no-misused-promises': 'off', //FIXME: Implement
39+
'@typescript-eslint/require-await': 'off', //FIXME: Implement
40+
'@typescript-eslint/no-floating-promise': 'off', //FIXME: Implement
41+
'@typescript-eslint/non-nullable-type-assertion-style': 'off', //FIXME: Implement
42+
'@typescript-eslint/no-unused-vars': 'off', //FIXME: Implement
43+
'@typescript-eslint/restrict-plus-operands': 'off', //FIXME: Implement
44+
'@typescript-eslint/no-duplicate-type-constituents': 'off', //FIXME: Implement
45+
'@typescript-eslint/no-floating-promises': 'off', //FIXME: Implement
46+
'@typescript-eslint/no-unsafe-return': 'off', //FIXME: Implement
47+
'@typescript-eslint/unbound-method': 'off', //FIXME: Implement
48+
'@typescript-eslint/restrict-template-expressions': 'off', //FIXME: Implement
49+
'@typescript-eslint/no-unused-expressions': 'off', //FIXME: Implement
50+
'@typescript-eslint/no-inferrable-types': 'off', //FIXME: Implement
51+
'@typescript-eslint/array-type': 'off', //FIXME: Implement
52+
'@typescript-eslint/no-require-imports': 'off', //FIXME: Implement
53+
'@typescript-eslint/consistent-type-definitions': 'off', //FIXME: Implement
54+
'@typescript-eslint/no-non-null-assertion': 'error', //FIXME: Implement
55+
56+
// 'no-tabs': 'off',
57+
// indent: 'off',
58+
// '@typescript-eslint/indent': 'off',
59+
// '@typescript-eslint/space-before-function-paren': 'off',
60+
// '@typescript-eslint/explicit-function-return-type': 'off',
61+
// 'no-return-await': 'off',
62+
// '@typescript-eslint/return-await': 'off',
63+
// '@typescript-eslint/no-unused-vars': 'warn',
64+
// '@typescript-eslint/restrict-template-expressions': 'off'
65+
},
66+
}
67+
)

src/pesterTestController.ts

-1
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,6 @@ export class PesterTestController implements Disposable {
845845
scriptArgs.push('-PipeName')
846846
scriptArgs.push(this.returnServer.name)
847847
// TODO: Fix non-null assertion
848-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
849848
const powershellExtensionClient = await this.powerShellExtensionClientPromise
850849
await powershellExtensionClient.RunCommand(
851850
scriptPath,

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"esModuleInterop": true,
1010
"allowSyntheticDefaultImports": true
1111
},
12-
"exclude": ["node_modules", ".vscode-test", "*.config.ts"]
12+
"exclude": ["node_modules", ".vscode-test", "*.config.ts", "vscode.d.ts"]
1313
}

0 commit comments

Comments
 (0)