|
| 1 | +import { defineConfig } from 'eslint/config'; |
1 | 2 | import eslint from '@eslint/js'; |
2 | 3 | import tseslint from 'typescript-eslint'; |
3 | 4 | import jest from 'eslint-plugin-jest'; |
4 | 5 | import eslintConfigPrettier from 'eslint-config-prettier'; |
5 | 6 |
|
6 | | -export default (tsconfigRootDir) => [ |
7 | | - { |
8 | | - files: ['test/**/*.ts'], |
9 | | - ...eslint.configs.recommended, |
10 | | - }, |
11 | | - ...tseslint.configs.recommendedTypeChecked.map((config) => ({ |
12 | | - files: ['test/**/*.ts'], |
13 | | - ...config, |
14 | | - })), |
15 | | - ...tseslint.configs.stylisticTypeChecked.map((config) => ({ |
16 | | - files: ['test/**/*.ts'], |
17 | | - ...config, |
18 | | - })), |
19 | | - { |
20 | | - files: ['test/**/*.ts'], |
21 | | - languageOptions: { |
22 | | - parserOptions: { |
23 | | - project: ['./tsconfig.test.json'], |
24 | | - tsconfigRootDir, |
| 7 | +export default (tsconfigRootDir) => |
| 8 | + defineConfig([ |
| 9 | + { |
| 10 | + files: ['test/**/*.ts'], |
| 11 | + ...eslint.configs.recommended, |
| 12 | + }, |
| 13 | + ...tseslint.configs.recommendedTypeChecked.map((config) => ({ |
| 14 | + files: ['test/**/*.ts'], |
| 15 | + ...config, |
| 16 | + })), |
| 17 | + ...tseslint.configs.stylisticTypeChecked.map((config) => ({ |
| 18 | + files: ['test/**/*.ts'], |
| 19 | + ...config, |
| 20 | + })), |
| 21 | + { |
| 22 | + files: ['test/**/*.ts'], |
| 23 | + languageOptions: { |
| 24 | + parserOptions: { |
| 25 | + project: ['./tsconfig.test.json'], |
| 26 | + tsconfigRootDir, |
| 27 | + }, |
25 | 28 | }, |
26 | 29 | }, |
27 | | - }, |
28 | | - { |
29 | | - files: ['test/**/*.ts'], |
30 | | - ...jest.configs['flat/recommended'], |
31 | | - }, |
32 | | - { |
33 | | - files: ['test/**/*.ts'], |
34 | | - ...jest.configs['jest/style'], |
35 | | - }, |
36 | | - { |
37 | | - files: ['test/**/*.ts'], |
38 | | - ...eslintConfigPrettier, |
39 | | - }, |
40 | | - { |
41 | | - files: ['test/**/*.ts'], |
42 | | - rules: { |
43 | | - '@typescript-eslint/no-unsafe-return': 'off', |
44 | | - '@typescript-eslint/no-unsafe-assignment': 'off', |
45 | | - '@typescript-eslint/no-unsafe-call': 'off', |
46 | | - '@typescript-eslint/no-unsafe-member-access': 'off', |
47 | | - '@typescript-eslint/prefer-optional-chain': 'off', |
48 | | - '@typescript-eslint/no-base-to-string': 'off', |
49 | | - '@typescript-eslint/consistent-indexed-object-style': 'off', |
50 | | - '@typescript-eslint/prefer-nullish-coalescing': 'off', |
51 | | - '@typescript-eslint/consistent-type-definitions': 'off', |
52 | | - '@typescript-eslint/no-unused-vars': 'off', |
53 | | - '@typescript-eslint/no-explicit-any': 'off', |
54 | | - '@typescript-eslint/prefer-for-of': 'off', |
55 | | - '@typescript-eslint/non-nullable-type-assertion-style': 'off', |
56 | | - '@typescript-eslint/class-literal-property-style': 'off', |
57 | | - '@typescript-eslint/no-redundant-type-constituents': 'off', |
58 | | - '@typescript-eslint/prefer-string-starts-ends-with': 'off', |
59 | | - '@typescript-eslint/no-duplicate-type-constituents': 'off', |
60 | | - '@typescript-eslint/array-type': 'off', |
61 | | - '@typescript-eslint/prefer-function-type': 'off', |
| 30 | + { |
| 31 | + files: ['test/**/*.ts'], |
| 32 | + ...jest.configs['flat/recommended'], |
| 33 | + }, |
| 34 | + { |
| 35 | + files: ['test/**/*.ts'], |
| 36 | + ...jest.configs['jest/style'], |
| 37 | + }, |
| 38 | + { |
| 39 | + files: ['test/**/*.ts'], |
| 40 | + ...eslintConfigPrettier, |
| 41 | + }, |
| 42 | + { |
| 43 | + files: ['test/**/*.ts'], |
| 44 | + rules: { |
| 45 | + '@typescript-eslint/no-unsafe-return': 'off', |
| 46 | + '@typescript-eslint/no-unsafe-assignment': 'off', |
| 47 | + '@typescript-eslint/no-unsafe-call': 'off', |
| 48 | + '@typescript-eslint/no-unsafe-member-access': 'off', |
| 49 | + '@typescript-eslint/prefer-optional-chain': 'off', |
| 50 | + '@typescript-eslint/no-base-to-string': 'off', |
| 51 | + '@typescript-eslint/consistent-indexed-object-style': 'off', |
| 52 | + '@typescript-eslint/prefer-nullish-coalescing': 'off', |
| 53 | + '@typescript-eslint/consistent-type-definitions': 'off', |
| 54 | + '@typescript-eslint/no-unused-vars': 'off', |
| 55 | + '@typescript-eslint/no-explicit-any': 'off', |
| 56 | + '@typescript-eslint/prefer-for-of': 'off', |
| 57 | + '@typescript-eslint/non-nullable-type-assertion-style': 'off', |
| 58 | + '@typescript-eslint/class-literal-property-style': 'off', |
| 59 | + '@typescript-eslint/no-redundant-type-constituents': 'off', |
| 60 | + '@typescript-eslint/prefer-string-starts-ends-with': 'off', |
| 61 | + '@typescript-eslint/no-duplicate-type-constituents': 'off', |
| 62 | + '@typescript-eslint/array-type': 'off', |
| 63 | + '@typescript-eslint/prefer-function-type': 'off', |
| 64 | + }, |
62 | 65 | }, |
63 | | - }, |
64 | | -]; |
| 66 | + ]); |
0 commit comments