|
| 1 | +// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format |
| 2 | +import storybook from "eslint-plugin-storybook"; |
| 3 | + |
1 | 4 | import tseslint from 'typescript-eslint'; |
2 | 5 | import prettierConfig from 'eslint-config-prettier'; |
3 | 6 |
|
4 | | -export default tseslint.config( |
5 | | - { |
6 | | - ignores: ['dist/**', 'node_modules/**', '.angular/**', '**/*.spec.ts'], |
7 | | - }, |
8 | | - { |
9 | | - files: ['eslint.config.js'], |
10 | | - languageOptions: { |
11 | | - parserOptions: { |
12 | | - projectService: null, |
13 | | - }, |
14 | | - }, |
15 | | - rules: { |
16 | | - 'no-unused-vars': 'off', |
17 | | - 'no-undef': 'off', |
18 | | - '@typescript-eslint/no-unsafe-assignment': 'off', |
19 | | - '@typescript-eslint/prefer-nullish-coalescing': 'off', |
20 | | - '@typescript-eslint/prefer-optional-chain': 'off', |
21 | | - '@typescript-eslint/consistent-type-definitions': 'off', |
22 | | - '@typescript-eslint/no-unused-vars': 'off', |
23 | | - '@typescript-eslint/no-explicit-any': 'off', |
| 7 | +export default tseslint.config({ |
| 8 | + ignores: ['dist/**', 'node_modules/**', '.angular/**', 'storybook-static/**', '**/*.spec.ts'], |
| 9 | +}, { |
| 10 | + files: ['eslint.config.js'], |
| 11 | + languageOptions: { |
| 12 | + parserOptions: { |
| 13 | + projectService: null, |
24 | 14 | }, |
25 | 15 | }, |
26 | | - ...tseslint.configs.recommended, |
27 | | - { |
28 | | - files: ['src/**/*.ts'], |
29 | | - languageOptions: { |
30 | | - parserOptions: { |
31 | | - projectService: true, |
32 | | - tsconfigRootDir: import.meta.dirname, |
33 | | - }, |
34 | | - }, |
35 | | - rules: { |
36 | | - ...prettierConfig.rules, |
37 | | - '@typescript-eslint/no-explicit-any': 'error', |
38 | | - '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], |
39 | | - '@typescript-eslint/prefer-nullish-coalescing': 'error', |
40 | | - '@typescript-eslint/prefer-optional-chain': 'error', |
41 | | - '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], |
42 | | - '@typescript-eslint/no-non-null-assertion': 'warn', |
43 | | - 'no-console': ['warn', { allow: ['warn', 'error'] }], |
44 | | - 'prefer-const': 'error', |
45 | | - 'no-var': 'error', |
46 | | - eqeqeq: ['error', 'always'], |
47 | | - }, |
| 16 | + rules: { |
| 17 | + 'no-unused-vars': 'off', |
| 18 | + 'no-undef': 'off', |
| 19 | + '@typescript-eslint/no-unsafe-assignment': 'off', |
| 20 | + '@typescript-eslint/prefer-nullish-coalescing': 'off', |
| 21 | + '@typescript-eslint/prefer-optional-chain': 'off', |
| 22 | + '@typescript-eslint/consistent-type-definitions': 'off', |
| 23 | + '@typescript-eslint/no-unused-vars': 'off', |
| 24 | + '@typescript-eslint/no-explicit-any': 'off', |
48 | 25 | }, |
49 | | - { |
50 | | - files: ['src/**/*.spec.ts', 'src/**/*.test.ts'], |
51 | | - rules: { |
52 | | - '@typescript-eslint/no-non-null-assertion': 'off', |
53 | | - '@typescript-eslint/no-unsafe-assignment': 'off', |
| 26 | +}, ...tseslint.configs.recommended, { |
| 27 | + files: ['src/**/*.ts'], |
| 28 | + languageOptions: { |
| 29 | + parserOptions: { |
| 30 | + projectService: true, |
| 31 | + tsconfigRootDir: import.meta.dirname, |
54 | 32 | }, |
55 | 33 | }, |
56 | | -); |
| 34 | + rules: { |
| 35 | + ...prettierConfig.rules, |
| 36 | + '@typescript-eslint/no-explicit-any': 'error', |
| 37 | + '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], |
| 38 | + '@typescript-eslint/prefer-nullish-coalescing': 'error', |
| 39 | + '@typescript-eslint/prefer-optional-chain': 'error', |
| 40 | + '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], |
| 41 | + '@typescript-eslint/no-non-null-assertion': 'warn', |
| 42 | + 'no-console': ['warn', { allow: ['warn', 'error'] }], |
| 43 | + 'prefer-const': 'error', |
| 44 | + 'no-var': 'error', |
| 45 | + eqeqeq: ['error', 'always'], |
| 46 | + }, |
| 47 | +}, { |
| 48 | + files: ['src/**/*.spec.ts', 'src/**/*.test.ts'], |
| 49 | + rules: { |
| 50 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 51 | + '@typescript-eslint/no-unsafe-assignment': 'off', |
| 52 | + }, |
| 53 | +}, storybook.configs["flat/recommended"]); |
0 commit comments