|
| 1 | +const sharedExtends = [ |
| 2 | + require.resolve('./src/prettier.js'), |
| 3 | + require.resolve('./src/eslint.js'), |
| 4 | + require.resolve('./src/import.js'), |
| 5 | + require.resolve('./src/turbo.js'), |
| 6 | + require.resolve('./src/simple-import-sort.js') |
| 7 | +] |
| 8 | + |
1 | 9 | module.exports = { |
2 | 10 | extends: [ |
3 | | - 'eslint:recommended', |
4 | | - 'prettier', |
5 | | - 'turbo', |
6 | | - 'plugin:@typescript-eslint/eslint-recommended', |
7 | | - 'plugin:@typescript-eslint/recommended', |
8 | | - 'plugin:import/recommended' |
| 11 | + require.resolve('./src/airbnb-base.js'), |
| 12 | + ...sharedExtends |
9 | 13 | ], |
10 | | - processor: 'disable/disable', |
11 | | - parser: '@typescript-eslint/parser', |
12 | | - parserOptions: { |
13 | | - project: './tsconfig.json' |
14 | | - }, |
15 | | - plugins: [ '@typescript-eslint', 'eslint-plugin-unicorn', 'disable', 'simple-import-sort', 'json-files', 'no-relative-import-paths', 'relative-imports-when-same-folder'], |
16 | | - rules: { |
17 | | - 'simple-import-sort/imports': 'error', |
18 | | - 'simple-import-sort/exports': 'error', |
19 | | - 'import/prefer-default-export': 'off', |
20 | | - 'import/extensions': 'off', |
21 | | - 'import/no-unresolved': 'off', |
22 | | - 'import/no-extraneous-dependencies': 'off', |
23 | | - 'import/first': 'error', |
24 | | - 'import/no-duplicates': 'error', |
25 | | - 'space-before-blocks': [ 'error', 'always' ], |
26 | | - 'import/newline-after-import': [ 'error', { 'count': 1 } ], |
27 | | - 'no-multiple-empty-lines': ['error', { 'max': 1, 'maxEOF': 1, 'maxBOF': 0 }], |
28 | | - 'import/no-named-as-default': 'error', |
29 | | - 'import/no-default-export': 'error', |
30 | | - 'import/no-useless-path-segments': 'error', |
31 | | - 'import/no-cycle': 'error', |
32 | | - 'import/no-self-import': 'error', |
33 | | - 'import/no-relative-packages': 'error', |
34 | | - 'object-curly-spacing': [ 'error', 'always' ], |
35 | | - 'comma-spacing': ['error', { 'before': false, 'after': true }], |
36 | | - 'comma-dangle': ['error', 'never'], |
37 | | - 'computed-property-spacing': [ 'error', 'always' ], |
38 | | - 'no-console': 'off', |
39 | | - 'arrow-body-style': ['error', 'always'], |
40 | | - 'arrow-parens': ['error', 'always'], |
41 | | - 'quotes': ['error', 'single', { 'avoidEscape': true }], |
42 | | - 'no-return-assign': 'off', |
43 | | - 'function-paren-newline': ['error', 'never'], |
44 | | - 'brace-style': 'error', |
45 | | - 'class-methods-use-this': 'off', |
46 | | - '@typescript-eslint/no-empty-interface': 'off', |
47 | | - 'indent': ['error', 2], |
48 | | - 'no-unused-vars': 'off', |
49 | | - 'no-underscore-dangle': 'off', |
50 | | - 'no-nested-ternary': 'off', |
51 | | - '@typescript-eslint/no-shadow': 'off', |
52 | | - 'no-await-in-loop': 'off', |
53 | | - 'no-plusplus': 'off', |
54 | | - '@typescript-eslint/no-namespace': 'off', |
55 | | - '@typescript-eslint/lines-between-class-members': 'off', |
56 | | - 'default-case': 'off', |
57 | | - 'no-restricted-syntax': 'off', |
58 | | - '@typescript-eslint/no-unused-expressions': 'off', |
59 | | - '@typescript-eslint/no-explicit-any': 'off', |
60 | | - '@typescript-eslint/no-loop-func': 'off', |
61 | | - 'lines-between-class-members': ['error', 'always'], |
62 | | - 'no-continue': 'off', |
63 | | - 'no-relative-import-paths/no-relative-import-paths': [ |
64 | | - 'error', |
65 | | - { 'allowSameFolder': true, 'rootDir': 'src', 'prefix': '@' } |
66 | | - ], |
67 | | - 'relative-imports-when-same-folder/no-relative-imports-when-same-folder': 'error' |
68 | | - }, |
69 | | - 'settings': { |
70 | | - 'import/resolver': { |
71 | | - 'typescript': {} |
72 | | - } |
73 | | - }, |
| 14 | + ignorePatterns: ['build.mjs', 'turbowatch.ts', 'vitest.config.ts', '*.test.ts'], |
74 | 15 | overrides: [ |
75 | 16 | { |
76 | | - files: [ '**/package.json' ], |
77 | | - plugins: [ 'json-files' ], |
78 | | - parser: 'espree', |
79 | | - rules: { |
80 | | - 'json-files/sort-package-json': 'error', |
81 | | - 'json-files/require-license': 'error', |
82 | | - 'json-files/restrict-ranges': 'error', |
83 | | - 'json-files/require-unique-dependency-names': 'error', |
84 | | - 'relative-imports-when-same-folder/no-relative-imports-when-same-folder': 'off' |
| 17 | + files: ['*.ts'], |
| 18 | + extends: [ |
| 19 | + require.resolve('./src/airbnb-base.js'), |
| 20 | + require.resolve('./src/airbnb-typescript-base.js'), |
| 21 | + require.resolve('./src/no-relative-import-paths.js'), |
| 22 | + require.resolve('./src/relative-imports-when-same-folder.js'), |
| 23 | + ...sharedExtends |
| 24 | + ], |
| 25 | + parserOptions: { |
| 26 | + project: './tsconfig.json' |
85 | 27 | } |
86 | 28 | }, |
87 | 29 | { |
88 | | - files: [ '**/*.js' ], |
89 | | - parser: 'espree', |
90 | | - rules: { |
91 | | - 'relative-imports-when-same-folder/no-relative-imports-when-same-folder': 'off' |
92 | | - } |
| 30 | + files: ['*.json'], |
| 31 | + extends: [ |
| 32 | + require.resolve('./src/json-files.js') |
| 33 | + ] |
93 | 34 | } |
94 | 35 | ] |
95 | | -}; |
| 36 | +} |
0 commit comments