|
1 | 1 | // eslint.config.js |
2 | | -import js from "@eslint/js"; |
3 | | -import ts from "typescript-eslint"; |
4 | | -import prettierRecommended from "eslint-plugin-prettier/recommended"; |
5 | | -import importPlugin from "eslint-plugin-import"; |
6 | | -import unusedImports from "eslint-plugin-unused-imports"; |
7 | | -import pluginPromise from "eslint-plugin-promise"; |
| 2 | +import js from '@eslint/js'; |
| 3 | +import ts from 'typescript-eslint'; |
| 4 | +import prettierRecommended from 'eslint-plugin-prettier/recommended'; |
| 5 | +import importPlugin from 'eslint-plugin-import'; |
| 6 | +import unusedImports from 'eslint-plugin-unused-imports'; |
| 7 | +import pluginPromise from 'eslint-plugin-promise'; |
8 | 8 |
|
9 | 9 | export default ts.config( |
10 | 10 | js.configs.recommended, |
11 | 11 | ts.configs.recommendedTypeChecked, |
12 | 12 | prettierRecommended, |
13 | 13 | importPlugin.flatConfigs.recommended, |
14 | | - pluginPromise.configs["flat/recommended"], |
| 14 | + pluginPromise.configs['flat/recommended'], |
15 | 15 | { |
16 | 16 | languageOptions: { |
17 | 17 | ecmaVersion: 2022, |
18 | | - sourceType: "module", |
| 18 | + sourceType: 'module', |
19 | 19 | parserOptions: { |
20 | | - project: ["./tsconfig.eslint.json"], |
| 20 | + project: ['./tsconfig.eslint.json'], |
21 | 21 | tsconfigRootDir: import.meta.dirname, |
22 | 22 | }, |
23 | 23 | }, |
24 | 24 | plugins: { |
25 | | - "unused-imports": unusedImports, |
| 25 | + 'unused-imports': unusedImports, |
26 | 26 | }, |
27 | | - files: ["{src,test}/**/*.{js,ts}"], |
| 27 | + files: ['{src,test}/**/*.{js,ts}'], |
28 | 28 | rules: { |
29 | 29 | // Basic code quality rules |
30 | | - "no-console": "off", |
31 | | - "prefer-const": "warn", |
32 | | - "no-var": "warn", |
33 | | - eqeqeq: ["warn", "always"], |
| 30 | + 'no-console': 'off', |
| 31 | + 'prefer-const': 'warn', |
| 32 | + 'no-var': 'warn', |
| 33 | + eqeqeq: ['warn', 'always'], |
34 | 34 |
|
35 | 35 | // Light complexity rules |
36 | | - complexity: ["warn", { max: 20 }], |
37 | | - "max-depth": ["warn", { max: 4 }], |
38 | | - "max-lines-per-function": ["warn", { max: 150 }], |
| 36 | + complexity: ['warn', { max: 20 }], |
| 37 | + 'max-depth': ['warn', { max: 4 }], |
| 38 | + 'max-lines-per-function': ['warn', { max: 150 }], |
39 | 39 |
|
40 | | - "@typescript-eslint/no-unsafe-assignment": "off", |
41 | | - "@typescript-eslint/no-explicit-any": "off", |
42 | | - "@typescript-eslint/no-unsafe-member-access": "off", |
43 | | - "@typescript-eslint/no-unsafe-call": "off", |
44 | | - "@typescript-eslint/no-unsafe-return": "off", |
45 | | - "@typescript-eslint/no-unsafe-argument": "off", |
46 | | - "@typescript-eslint/no-explicit-any": "off", |
47 | | - "@typescript-eslint/no-unused-vars": [ |
48 | | - "error", |
49 | | - { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, |
| 40 | + '@typescript-eslint/no-unsafe-assignment': 'off', |
| 41 | + '@typescript-eslint/no-explicit-any': 'off', |
| 42 | + '@typescript-eslint/no-unsafe-member-access': 'off', |
| 43 | + '@typescript-eslint/no-unsafe-call': 'off', |
| 44 | + '@typescript-eslint/no-unsafe-return': 'off', |
| 45 | + '@typescript-eslint/no-unsafe-argument': 'off', |
| 46 | + '@typescript-eslint/no-explicit-any': 'off', |
| 47 | + '@typescript-eslint/no-unused-vars': [ |
| 48 | + 'error', |
| 49 | + { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }, |
50 | 50 | ], |
51 | 51 |
|
52 | | - "import/no-unresolved": "off", |
53 | | - "import/named": "off", |
54 | | - "import/extensions": [ |
55 | | - "error", |
56 | | - "ignorePackages", |
57 | | - { js: "always", ts: "never" }, |
| 52 | + 'import/no-unresolved': 'off', |
| 53 | + 'import/named': 'off', |
| 54 | + 'import/extensions': [ |
| 55 | + 'error', |
| 56 | + 'ignorePackages', |
| 57 | + { js: 'always', ts: 'never' }, |
58 | 58 | ], |
59 | 59 |
|
60 | | - "no-unused-vars": "off", // or "@typescript-eslint/no-unused-vars": "off", |
61 | | - "unused-imports/no-unused-imports": "error", |
| 60 | + 'no-unused-vars': 'off', // or "@typescript-eslint/no-unused-vars": "off", |
| 61 | + 'unused-imports/no-unused-imports': 'error', |
62 | 62 |
|
63 | | - "promise/always-return": "error", |
64 | | - "promise/no-return-wrap": "error", |
65 | | - "promise/param-names": "error", |
66 | | - "promise/catch-or-return": "error", |
67 | | - "promise/no-native": "off", |
68 | | - "promise/no-nesting": "warn", |
69 | | - "promise/no-promise-in-callback": "warn", |
70 | | - "promise/no-callback-in-promise": "warn", |
71 | | - "promise/avoid-new": "off", |
72 | | - "promise/no-new-statics": "error", |
73 | | - "promise/no-return-in-finally": "warn", |
74 | | - "promise/valid-params": "warn", |
75 | | - "promise/no-multiple-resolved": "error", |
| 63 | + 'promise/always-return': 'error', |
| 64 | + 'promise/no-return-wrap': 'error', |
| 65 | + 'promise/param-names': 'error', |
| 66 | + 'promise/catch-or-return': 'error', |
| 67 | + 'promise/no-native': 'off', |
| 68 | + 'promise/no-nesting': 'warn', |
| 69 | + 'promise/no-promise-in-callback': 'warn', |
| 70 | + 'promise/no-callback-in-promise': 'warn', |
| 71 | + 'promise/avoid-new': 'off', |
| 72 | + 'promise/no-new-statics': 'error', |
| 73 | + 'promise/no-return-in-finally': 'warn', |
| 74 | + 'promise/valid-params': 'warn', |
| 75 | + 'promise/no-multiple-resolved': 'error', |
76 | 76 | }, |
77 | | - } |
| 77 | + }, |
78 | 78 | ); |
0 commit comments