|
1 |
| -import globals from 'globals'; |
2 |
| -import js from '@eslint/js'; |
3 |
| - |
4 |
| -export default [ |
5 |
| - js.configs.recommended, |
6 |
| - { |
7 |
| - ignores: ['docs/**', 'tests/**', 'node_modules/*'], |
8 |
| - languageOptions: { |
9 |
| - ecmaVersion: 2021, |
10 |
| - sourceType: 'commonjs', |
11 |
| - globals: { |
12 |
| - ...globals.commonjs, |
13 |
| - ...globals.es2021, |
14 |
| - ...globals.node |
15 |
| - } |
16 |
| - }, |
17 |
| - rules: { |
18 |
| - 'max-len': ['error', { code: 120, ignoreUrls: true, ignoreComments: true }], |
19 |
| - 'no-constant-condition': ['error', { checkLoops: false }], |
20 |
| - 'prefer-const': ['warn', { destructuring: 'all' }], |
21 |
| - 'no-unused-vars': ['error', { args: 'none' }], |
22 |
| - curly: ['warn', 'multi-line', 'consistent'], |
23 |
| - 'logical-assignment-operators': 'warn', |
24 |
| - 'no-template-curly-in-string': 'error', |
25 |
| - 'quote-props': ['error', 'as-needed'], |
26 |
| - 'comma-dangle': ['error', 'never'], |
27 |
| - 'no-useless-constructor': 'error', |
28 |
| - 'no-useless-assignment': 'error', |
29 |
| - 'no-inner-declarations': 'error', |
30 |
| - 'no-implicit-coercion': 'error', |
31 |
| - 'no-use-before-define': 'warn', |
32 |
| - 'no-underscore-dangle': 'warn', |
33 |
| - 'no-unneeded-ternary': 'error', |
34 |
| - 'default-param-last': 'error', |
35 |
| - 'one-var': ['warn', 'never'], |
36 |
| - 'no-inline-comments': 'warn', |
37 |
| - 'no-empty-function': 'error', |
38 |
| - 'no-useless-return': 'error', |
39 |
| - 'no-useless-rename': 'warn', |
40 |
| - 'no-useless-concat': 'warn', |
41 |
| - 'no-throw-literal': 'error', |
42 |
| - 'no-extend-native': 'error', |
43 |
| - 'default-case-last': 'warn', |
44 |
| - 'no-self-compare': 'error', |
45 |
| - 'no-new-wrappers': 'error', |
46 |
| - 'no-lone-blocks': 'error', |
47 |
| - 'no-undef-init': 'error', |
48 |
| - 'no-else-return': 'warn', |
49 |
| - 'no-extra-semi': 'error', |
50 |
| - 'require-await': 'warn', |
51 |
| - yoda: ['error', 'always'], |
52 |
| - 'default-case': 'error', |
53 |
| - 'dot-notation': 'error', |
54 |
| - 'no-sequences': 'warn', |
55 |
| - 'no-multi-str': 'warn', |
56 |
| - 'no-lonely-if': 'warn', |
57 |
| - 'no-new-func': 'error', |
58 |
| - 'no-console': 'error', |
59 |
| - camelcase: 'warn', |
60 |
| - 'no-var': 'warn', |
61 |
| - eqeqeq: 'warn', |
62 |
| - semi: 'error' |
63 |
| - } |
64 |
| - } |
65 |
| -]; |
| 1 | +import globals from 'globals'; |
| 2 | +import prettier from 'eslint-config-prettier'; |
| 3 | +import sortImports from '@j4cobi/eslint-plugin-sort-imports'; |
| 4 | +import js from '@eslint/js'; |
| 5 | + |
| 6 | +export default [ |
| 7 | + js.configs.recommended, |
| 8 | + prettier, |
| 9 | + { |
| 10 | + ignores: ['**/node_modules/', '**/pnpm-lock.yaml'], |
| 11 | + languageOptions: { |
| 12 | + ecmaVersion: 2022, |
| 13 | + sourceType: 'module', |
| 14 | + globals: { |
| 15 | + ...globals.es2022, |
| 16 | + ...globals.node |
| 17 | + } |
| 18 | + }, |
| 19 | + plugins: { 'sort-imports': sortImports }, |
| 20 | + rules: { |
| 21 | + 'sort-imports/sort-imports': [ |
| 22 | + 'error', |
| 23 | + { ignoreCase: false, ignoreMemberSort: false, memberSyntaxSortOrder: ['all', 'single', 'multiple', 'none'] } |
| 24 | + ], |
| 25 | + 'max-len': ['error', { code: 120, ignoreUrls: true, ignoreComments: true }], |
| 26 | + 'no-constant-condition': ['error', { checkLoops: false }], |
| 27 | + 'prefer-const': ['warn', { destructuring: 'all' }], |
| 28 | + 'no-unused-vars': ['error', { args: 'none' }], |
| 29 | + curly: ['warn', 'multi-line', 'consistent'], |
| 30 | + 'logical-assignment-operators': 'warn', |
| 31 | + 'no-template-curly-in-string': 'error', |
| 32 | + 'quote-props': ['error', 'as-needed'], |
| 33 | + 'comma-dangle': ['error', 'never'], |
| 34 | + 'no-useless-constructor': 'error', |
| 35 | + 'no-useless-assignment': 'error', |
| 36 | + 'no-inner-declarations': 'error', |
| 37 | + 'no-implicit-coercion': 'error', |
| 38 | + 'no-use-before-define': 'warn', |
| 39 | + 'no-underscore-dangle': 'warn', |
| 40 | + 'no-unneeded-ternary': 'error', |
| 41 | + 'default-param-last': 'error', |
| 42 | + 'one-var': ['warn', 'never'], |
| 43 | + 'no-inline-comments': 'warn', |
| 44 | + 'no-empty-function': 'error', |
| 45 | + 'no-useless-return': 'error', |
| 46 | + 'no-useless-rename': 'warn', |
| 47 | + 'no-useless-concat': 'warn', |
| 48 | + 'no-throw-literal': 'error', |
| 49 | + 'no-extend-native': 'error', |
| 50 | + 'default-case-last': 'warn', |
| 51 | + 'no-self-compare': 'error', |
| 52 | + 'no-new-wrappers': 'error', |
| 53 | + 'no-lone-blocks': 'error', |
| 54 | + 'no-undef-init': 'error', |
| 55 | + 'no-else-return': 'warn', |
| 56 | + 'no-extra-semi': 'error', |
| 57 | + 'require-await': 'warn', |
| 58 | + yoda: ['error', 'always'], |
| 59 | + 'default-case': 'error', |
| 60 | + 'dot-notation': 'error', |
| 61 | + 'no-sequences': 'warn', |
| 62 | + 'no-multi-str': 'warn', |
| 63 | + 'no-lonely-if': 'warn', |
| 64 | + 'no-new-func': 'error', |
| 65 | + 'no-console': 'error', |
| 66 | + camelcase: 'warn', |
| 67 | + 'no-var': 'warn', |
| 68 | + eqeqeq: 'warn', |
| 69 | + semi: 'error' |
| 70 | + } |
| 71 | + } |
| 72 | +]; |
0 commit comments