Skip to content

Commit

Permalink
Update ESLint to new rules and presets
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinGrote committed Oct 10, 2024
1 parent d6fda9d commit 5648ad2
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 39 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

30 changes: 0 additions & 30 deletions .eslintrc.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
singleQuote: true
trailingComma: none
trailingComma: es5
arrowParens: avoid
semi: false
tabWidth: 2
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
"mochaExplorer.env": {
"VSCODE_VERSION": "insiders",
"ELECTRON_RUN_AS_NODE": null
}
},
"eslint.useFlatConfig": true,
"eslint.useESLintClass": true
}
67 changes: 67 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import globals from 'globals'

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
ignores: [
'.vscode-test/**',
'dist/**',
'eslint.config.mjs',
'vscode.d.ts',
'vscode.proposed.d.ts',
'.vscode-test.js',
'*.config.js',
],
},
{
languageOptions: {
globals: {
...globals.node,
},
parser: tseslint.parser,
ecmaVersion: 2023,
parserOptions: {
// project: './tsconfig.json',
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'@typescript-eslint/no-unsafe-member-access': 'off', //FIXME: Implement
'@typescript-eslint/no-unsafe-assignment': 'off', //FIXME: Implement
'@typescript-eslint/no-unsafe-argument': 'off', //FIXME: Implement
'@typescript-eslint/no-unsafe-call': 'off', //FIXME: Implement
'@typescript-eslint/no-misused-promises': 'off', //FIXME: Implement
'@typescript-eslint/require-await': 'off', //FIXME: Implement
'@typescript-eslint/no-floating-promise': 'off', //FIXME: Implement
'@typescript-eslint/non-nullable-type-assertion-style': 'off', //FIXME: Implement
'@typescript-eslint/no-unused-vars': 'off', //FIXME: Implement
'@typescript-eslint/restrict-plus-operands': 'off', //FIXME: Implement
'@typescript-eslint/no-duplicate-type-constituents': 'off', //FIXME: Implement
'@typescript-eslint/no-floating-promises': 'off', //FIXME: Implement
'@typescript-eslint/no-unsafe-return': 'off', //FIXME: Implement
'@typescript-eslint/unbound-method': 'off', //FIXME: Implement
'@typescript-eslint/restrict-template-expressions': 'off', //FIXME: Implement
'@typescript-eslint/no-unused-expressions': 'off', //FIXME: Implement
'@typescript-eslint/no-inferrable-types': 'off', //FIXME: Implement
'@typescript-eslint/array-type': 'off', //FIXME: Implement
'@typescript-eslint/no-require-imports': 'off', //FIXME: Implement
'@typescript-eslint/consistent-type-definitions': 'off', //FIXME: Implement
'@typescript-eslint/no-non-null-assertion': 'error', //FIXME: Implement

// 'no-tabs': 'off',
// indent: 'off',
// '@typescript-eslint/indent': 'off',
// '@typescript-eslint/space-before-function-paren': 'off',
// '@typescript-eslint/explicit-function-return-type': 'off',
// 'no-return-await': 'off',
// '@typescript-eslint/return-await': 'off',
// '@typescript-eslint/no-unused-vars': 'warn',
// '@typescript-eslint/restrict-template-expressions': 'off'
},
}
)
1 change: 0 additions & 1 deletion src/pesterTestController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,6 @@ export class PesterTestController implements Disposable {
scriptArgs.push('-PipeName')
scriptArgs.push(this.returnServer.name)
// TODO: Fix non-null assertion
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const powershellExtensionClient = await this.powerShellExtensionClientPromise
await powershellExtensionClient.RunCommand(
scriptPath,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
},
"exclude": ["node_modules", ".vscode-test", "*.config.ts"]
"exclude": ["node_modules", ".vscode-test", "*.config.ts", "vscode.d.ts"]
}

0 comments on commit 5648ad2

Please sign in to comment.