diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index ed3d844d..00000000 --- a/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -vscode.d.ts -vscode.proposed.d.ts -dist -node_modules -.vscode-test diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index bcfabc8e..00000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,30 +0,0 @@ -extends: - - eslint:recommended - - plugin:@typescript-eslint/recommended - # - standard-with-typescript - - prettier #Disables all rules that conflict with prettier -parser: "@typescript-eslint/parser" -plugins: - - "@typescript-eslint" -rules: - 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 -env: - jest: true - node: true - es2021: true -overrides: - - files: - - "**/*.test.ts" - rules: - "@typescript-eslint/no-unused-expressions": off -parserOptions: - project: ./tsconfig.json - tsconfigRootDir: . diff --git a/.prettierrc.yml b/.prettierrc.yml index 9b52e787..35257e3d 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -1,5 +1,5 @@ singleQuote: true -trailingComma: none +trailingComma: es5 arrowParens: avoid semi: false tabWidth: 2 diff --git a/.vscode/settings.json b/.vscode/settings.json index dd0a37cc..5c55a600 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,5 +14,7 @@ "mochaExplorer.env": { "VSCODE_VERSION": "insiders", "ELECTRON_RUN_AS_NODE": null - } + }, + "eslint.useFlatConfig": true, + "eslint.useESLintClass": true } diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..11b9472e --- /dev/null +++ b/eslint.config.mjs @@ -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' + }, + } +) diff --git a/src/pesterTestController.ts b/src/pesterTestController.ts index 5c85f2ca..ab70d471 100644 --- a/src/pesterTestController.ts +++ b/src/pesterTestController.ts @@ -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, diff --git a/tsconfig.json b/tsconfig.json index 93f53a0d..a4a343a5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -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"] }