|
| 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 js from '@eslint/js'; |
2 | 5 | import globals from 'globals'; |
3 | 6 | import reactHooks from 'eslint-plugin-react-hooks'; |
4 | 7 | import reactRefresh from 'eslint-plugin-react-refresh'; |
5 | 8 | import tseslint from 'typescript-eslint'; |
6 | 9 |
|
7 | | -export default tseslint.config( |
8 | | - { ignores: ['dist', 'storybook-static', 'node_modules'] }, |
9 | | - { |
10 | | - extends: [js.configs.recommended, ...tseslint.configs.recommended], |
11 | | - files: ['**/*.{ts,tsx}'], |
12 | | - languageOptions: { |
13 | | - ecmaVersion: 2020, |
14 | | - globals: globals.browser, |
15 | | - }, |
16 | | - plugins: { |
17 | | - 'react-hooks': reactHooks, |
18 | | - 'react-refresh': reactRefresh, |
19 | | - }, |
20 | | - rules: { |
21 | | - ...reactHooks.configs.recommended.rules, |
22 | | - 'react-refresh/only-export-components': [ |
23 | | - 'warn', |
24 | | - { allowConstantExport: true }, |
25 | | - ], |
26 | | - '@typescript-eslint/no-unused-vars': [ |
27 | | - 'error', |
28 | | - { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }, |
29 | | - ], |
30 | | - }, |
31 | | - } |
32 | | -); |
| 10 | +export default tseslint.config({ ignores: ['dist', 'storybook-static', 'node_modules'] }, { |
| 11 | + extends: [js.configs.recommended, ...tseslint.configs.recommended], |
| 12 | + files: ['**/*.{ts,tsx}'], |
| 13 | + languageOptions: { |
| 14 | + ecmaVersion: 2020, |
| 15 | + globals: globals.browser, |
| 16 | + }, |
| 17 | + plugins: { |
| 18 | + 'react-hooks': reactHooks, |
| 19 | + 'react-refresh': reactRefresh, |
| 20 | + }, |
| 21 | + rules: { |
| 22 | + ...reactHooks.configs.recommended.rules, |
| 23 | + 'react-refresh/only-export-components': [ |
| 24 | + 'warn', |
| 25 | + { allowConstantExport: true }, |
| 26 | + ], |
| 27 | + '@typescript-eslint/no-unused-vars': [ |
| 28 | + 'error', |
| 29 | + { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }, |
| 30 | + ], |
| 31 | + }, |
| 32 | +}, storybook.configs["flat/recommended"]); |
33 | 33 |
|
0 commit comments