|
1 | 1 | module.exports = {
|
| 2 | + root: true, |
| 3 | + extends: ['eslint:recommended'], |
2 | 4 | env: {
|
3 | 5 | node: true,
|
4 | 6 | es2022: true,
|
5 | 7 | },
|
6 |
| - parser: '@typescript-eslint/parser', // Specifies the ESLint parser |
7 |
| - extends: [ |
8 |
| - 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin |
9 |
| - 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
10 |
| - 'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier |
11 |
| - 'plugin:node/recommended', |
12 |
| - 'plugin:security/recommended', |
13 |
| - 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. |
14 |
| - ], |
15 | 8 | parserOptions: {
|
16 | 9 | ecmaVersion: 'latest',
|
17 |
| - project: './tsconfig.eslint.json', |
18 |
| - sourceType: 'module', // Allows for the use of imports, |
19 |
| - }, |
20 |
| - rules: { |
21 |
| - 'node/no-extraneous-import': ['error', { allowModules: ['pino'] }], |
22 |
| - 'node/no-missing-import': 'off', |
23 |
| - 'node/no-unpublished-import': ['error', { allowModules: ['type-fest'] }], |
24 |
| - 'node/no-unsupported-features/es-syntax': 'off', |
25 |
| - '@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true, destructuredArrayIgnorePattern: '^_' }], |
26 |
| - '@typescript-eslint/camelcase': 'off', |
27 |
| - '@typescript-eslint/explicit-function-return-type': 'error', |
28 |
| - '@typescript-eslint/explicit-member-accessibility': ['error', { overrides: { constructors: 'no-public' } }], |
| 10 | + sourceType: 'module', |
29 | 11 | },
|
30 | 12 | overrides: [
|
31 | 13 | {
|
32 |
| - files: ['./**/*.ts]'], |
33 |
| - rules: { |
34 |
| - '@typescript-eslint/no-throw-literal': 'error', |
| 14 | + files: ['./**/*.ts'], |
| 15 | + parser: '@typescript-eslint/parser', // Specifies the ESLint parser |
| 16 | + extends: [ |
| 17 | + 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin |
| 18 | + 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
| 19 | + 'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier |
| 20 | + 'plugin:node/recommended', |
| 21 | + 'plugin:security/recommended', |
| 22 | + 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. |
| 23 | + ], |
| 24 | + parserOptions: { |
| 25 | + ecmaVersion: 'latest', |
| 26 | + project: './tsconfig.eslint.json', |
| 27 | + sourceType: 'module', // Allows for the use of imports, |
35 | 28 | },
|
36 |
| - }, |
37 |
| - { |
38 |
| - files: ['test/**/*.ts'], |
39 |
| - plugins: ['jest'], |
40 |
| - extends: ['plugin:jest/recommended'], |
41 | 29 | rules: {
|
42 |
| - 'node/no-unpublished-import': 'off', |
43 |
| - 'node/no-extraneous-import': 'off', |
44 |
| - '@typescript-eslint/unbound-method': 'off', |
45 |
| - 'jest/unbound-method': 'error', |
| 30 | + 'node/no-extraneous-import': ['error', { allowModules: ['pino'] }], |
| 31 | + 'node/no-missing-import': 'off', |
| 32 | + 'node/no-unpublished-import': ['error', { allowModules: ['type-fest'] }], |
| 33 | + 'node/no-unsupported-features/es-syntax': 'off', |
| 34 | + '@typescript-eslint/no-unused-vars': [ |
| 35 | + 'error', |
| 36 | + { ignoreRestSiblings: true, destructuredArrayIgnorePattern: '^_' }, |
| 37 | + ], |
| 38 | + '@typescript-eslint/camelcase': 'off', |
| 39 | + '@typescript-eslint/explicit-function-return-type': 'error', |
| 40 | + '@typescript-eslint/explicit-member-accessibility': ['error', { overrides: { constructors: 'no-public' } }], |
46 | 41 | },
|
47 |
| - }, |
48 |
| - ], |
49 |
| - settings: { |
50 |
| - 'import/resolvers': { |
51 |
| - typescript: { |
52 |
| - alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist` |
53 |
| - project: '.', |
| 42 | + overrides: [ |
| 43 | + { |
| 44 | + files: ['./**/*.ts]'], |
| 45 | + rules: { |
| 46 | + '@typescript-eslint/no-throw-literal': 'error', |
| 47 | + }, |
| 48 | + }, |
| 49 | + { |
| 50 | + files: ['test/**/*.ts'], |
| 51 | + plugins: ['jest'], |
| 52 | + extends: ['plugin:jest/recommended'], |
| 53 | + rules: { |
| 54 | + 'node/no-unpublished-import': 'off', |
| 55 | + 'node/no-extraneous-import': 'off', |
| 56 | + '@typescript-eslint/unbound-method': 'off', |
| 57 | + 'jest/unbound-method': 'error', |
| 58 | + }, |
| 59 | + }, |
| 60 | + ], |
| 61 | + settings: { |
| 62 | + 'import/resolvers': { |
| 63 | + typescript: { |
| 64 | + alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist` |
| 65 | + project: '.', |
| 66 | + }, |
| 67 | + }, |
54 | 68 | },
|
55 | 69 | },
|
56 |
| - }, |
| 70 | + ], |
57 | 71 | };
|
0 commit comments