|
1 | 1 | import js from '@eslint/js'; |
2 | 2 | import globals from 'globals'; |
3 | | -import reactHooks from 'eslint-plugin-react-hooks'; |
4 | 3 | import reactRefresh from 'eslint-plugin-react-refresh'; |
5 | 4 | import tseslint from 'typescript-eslint'; |
| 5 | +import reactHooksPlugin from 'eslint-plugin-react-hooks'; |
6 | 6 |
|
7 | | -export default tseslint.config( |
8 | | - { ignores: ['dist'] }, |
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-refresh': reactRefresh, |
18 | | - }, |
19 | | - rules: { |
20 | | - 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], |
21 | | - }, |
| 7 | +export default tseslint.config({ ignores: ['dist'] }, reactHooksPlugin.configs.flat.recommended, { |
| 8 | + extends: [js.configs.recommended, ...tseslint.configs.recommended], |
| 9 | + files: ['**/*.{ts,tsx}'], |
| 10 | + languageOptions: { |
| 11 | + ecmaVersion: 2020, |
| 12 | + globals: globals.browser, |
22 | 13 | }, |
23 | | -); |
| 14 | + plugins: { |
| 15 | + 'react-refresh': reactRefresh, |
| 16 | + }, |
| 17 | + rules: { |
| 18 | + 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], |
| 19 | + }, |
| 20 | +}); |
0 commit comments