|
1 | | -import js from '@eslint/js' |
2 | | -import globals from 'globals' |
3 | | -import react from 'eslint-plugin-react' |
4 | | -import reactHooks from 'eslint-plugin-react-hooks' |
5 | | -import reactRefresh from 'eslint-plugin-react-refresh' |
| 1 | +import js from '@eslint/js'; |
| 2 | +import globals from 'globals'; |
| 3 | +import react from 'eslint-plugin-react'; |
| 4 | +import reactHooks from 'eslint-plugin-react-hooks'; |
| 5 | +import reactRefresh from 'eslint-plugin-react-refresh'; |
6 | 6 |
|
7 | 7 | export default [ |
8 | 8 | { ignores: ['dist'] }, |
9 | 9 | { |
10 | | - files: ['**/*.{js,jsx}'], |
| 10 | + files: ['**/*.{js,jsx,ts,tsx}'], // Added ts, tsx support |
11 | 11 | languageOptions: { |
12 | | - ecmaVersion: 2020, |
| 12 | + ecmaVersion: 'latest', // Unified the ECMA version declaration |
13 | 13 | globals: globals.browser, |
14 | 14 | parserOptions: { |
15 | | - ecmaVersion: 'latest', |
16 | 15 | ecmaFeatures: { jsx: true }, |
17 | 16 | sourceType: 'module', |
18 | 17 | }, |
19 | 18 | }, |
20 | 19 | settings: { react: { version: '18.3' } }, |
21 | | - plugins: { |
| 20 | + plugins: [ |
22 | 21 | react, |
23 | | - 'react-hooks': reactHooks, |
24 | | - 'react-refresh': reactRefresh, |
25 | | - }, |
| 22 | + reactHooks, |
| 23 | + reactRefresh, |
| 24 | + ], // Changed plugins to an array as required by ESLint v9 |
26 | 25 | rules: { |
27 | 26 | ...js.configs.recommended.rules, |
28 | 27 | ...react.configs.recommended.rules, |
29 | 28 | ...react.configs['jsx-runtime'].rules, |
30 | 29 | ...reactHooks.configs.recommended.rules, |
31 | 30 | 'react/jsx-no-target-blank': 'off', |
32 | | - 'react-refresh/only-export-components': [ |
33 | | - 'warn', |
34 | | - { allowConstantExport: true }, |
35 | | - ], |
| 31 | + 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], |
36 | 32 | }, |
37 | 33 | }, |
38 | | -] |
| 34 | +]; |
0 commit comments