|
| 1 | +import js from '@eslint/js' |
| 2 | +import react from 'eslint-plugin-react' |
| 3 | +import reactHooks from 'eslint-plugin-react-hooks' |
| 4 | +import reactRefresh from 'eslint-plugin-react-refresh' |
| 5 | +import globals from 'globals' |
| 6 | +import tseslint from 'typescript-eslint' |
| 7 | + |
| 8 | +export default tseslint.config( |
| 9 | + { ignores: ['dist'] }, |
| 10 | + { |
| 11 | + extends: [js.configs.recommended, ...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked], |
| 12 | + // Set the react version |
| 13 | + settings: { react: { version: '18.3' } }, |
| 14 | + files: ['src/**/*.{ts,tsx}'], |
| 15 | + languageOptions: { |
| 16 | + ecmaVersion: 2020, |
| 17 | + globals: globals.browser, |
| 18 | + parserOptions: { |
| 19 | + project: './tsconfig.json', |
| 20 | + tsconfigRootDir: import.meta.dirname, |
| 21 | + }, |
| 22 | + }, |
| 23 | + plugins: { |
| 24 | + react, |
| 25 | + 'react-hooks': reactHooks, |
| 26 | + 'react-refresh': reactRefresh, |
| 27 | + }, |
| 28 | + rules: { |
| 29 | + ...reactHooks.configs.recommended.rules, |
| 30 | + 'react-refresh/only-export-components': [ |
| 31 | + 'warn', |
| 32 | + { allowConstantExport: true }, |
| 33 | + ], |
| 34 | + ...react.configs.recommended.rules, |
| 35 | + ...react.configs['jsx-runtime'].rules, |
| 36 | + |
| 37 | + '@typescript-eslint/restrict-template-expressions': 'off', |
| 38 | + }, |
| 39 | + }, |
| 40 | +) |
0 commit comments