|
1 | 1 | // @ts-check |
2 | 2 |
|
3 | 3 | import eslint from "@eslint/js"; |
4 | | -import eslintPluginPrettierRecommended from "eslint-plugin-prettier"; |
| 4 | +import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; |
5 | 5 | import tseslint from "typescript-eslint"; |
6 | 6 |
|
7 | 7 | import { dirname } from "path"; |
8 | 8 | import { fileURLToPath } from "url"; |
9 | 9 |
|
10 | | -export default tseslint.config({ |
11 | | - files: ["**/*.ts"], |
12 | | - extends: [ |
13 | | - eslint.configs.recommended, |
14 | | - ...tseslint.configs.recommendedTypeChecked, |
15 | | - ], |
16 | | - rules: { |
17 | | - "@typescript-eslint/no-unused-vars": [ |
18 | | - "error", |
19 | | - { |
20 | | - args: "all", |
21 | | - argsIgnorePattern: "^_", |
22 | | - caughtErrors: "all", |
23 | | - caughtErrorsIgnorePattern: "^_", |
24 | | - destructuredArrayIgnorePattern: "^_", |
25 | | - varsIgnorePattern: "^_", |
26 | | - ignoreRestSiblings: true, |
27 | | - }, |
28 | | - ], |
29 | | - "@typescript-eslint/unbound-method": ["error", { ignoreStatic: true }], |
30 | | - "@typescript-eslint/no-unsafe-member-access": "off", |
31 | | - "@typescript-eslint/require-await": "off", |
32 | | - "no-empty": "off", |
33 | | - "prefer-const": [ |
34 | | - "error", |
35 | | - { ignoreReadBeforeAssign: true, destructuring: "all" }, |
| 10 | +export default [ |
| 11 | + ...tseslint.config({ |
| 12 | + files: ["**/*.ts"], |
| 13 | + extends: [ |
| 14 | + eslint.configs.recommended, |
| 15 | + ...tseslint.configs.recommendedTypeChecked, |
36 | 16 | ], |
37 | | - }, |
38 | | - plugins: { prettier: eslintPluginPrettierRecommended }, |
39 | | - languageOptions: { |
40 | | - parserOptions: { |
41 | | - project: true, |
42 | | - tsconfigRootDir: dirname(fileURLToPath(import.meta.url)), |
| 17 | + rules: { |
| 18 | + "@typescript-eslint/no-unused-vars": [ |
| 19 | + "error", |
| 20 | + { |
| 21 | + args: "all", |
| 22 | + argsIgnorePattern: "^_", |
| 23 | + caughtErrors: "all", |
| 24 | + caughtErrorsIgnorePattern: "^_", |
| 25 | + destructuredArrayIgnorePattern: "^_", |
| 26 | + varsIgnorePattern: "^_", |
| 27 | + ignoreRestSiblings: true, |
| 28 | + }, |
| 29 | + ], |
| 30 | + "@typescript-eslint/unbound-method": ["error", { ignoreStatic: true }], |
| 31 | + "@typescript-eslint/no-unsafe-member-access": "off", |
| 32 | + "@typescript-eslint/require-await": "off", |
| 33 | + "no-empty": "off", |
| 34 | + "prefer-const": [ |
| 35 | + "error", |
| 36 | + { ignoreReadBeforeAssign: true, destructuring: "all" }, |
| 37 | + ], |
| 38 | + }, |
| 39 | + languageOptions: { |
| 40 | + parserOptions: { |
| 41 | + project: true, |
| 42 | + tsconfigRootDir: dirname(fileURLToPath(import.meta.url)), |
| 43 | + }, |
43 | 44 | }, |
44 | | - }, |
45 | | -}); |
| 45 | + }), |
| 46 | + eslintPluginPrettierRecommended, |
| 47 | +]; |
0 commit comments