| 1 | import { defineConfig } from 'eslint/config' |
| 2 | import tseslint from '@electron-toolkit/eslint-config-ts' |
| 3 | import eslintConfigPrettier from '@electron-toolkit/eslint-config-prettier' |
| 4 | import eslintPluginReact from 'eslint-plugin-react' |
| 5 | import eslintPluginReactHooks from 'eslint-plugin-react-hooks' |
| 6 | import eslintPluginReactRefresh from 'eslint-plugin-react-refresh' |
| 7 | |
| 8 | export default defineConfig( |
| 9 | { ignores: ['**/node_modules', '**/dist', '**/out'] }, |
| 10 | tseslint.configs.recommended, |
| 11 | eslintPluginReact.configs.flat.recommended, |
| 12 | eslintPluginReact.configs.flat['jsx-runtime'], |
| 13 | { |
| 14 | settings: { |
| 15 | react: { |
| 16 | version: 'detect' |
| 17 | } |
| 18 | } |
| 19 | }, |
| 20 | { |
| 21 | files: ['**/*.{ts,tsx}'], |
| 22 | plugins: { |
| 23 | 'react-hooks': eslintPluginReactHooks, |
| 24 | 'react-refresh': eslintPluginReactRefresh |
| 25 | }, |
| 26 | rules: { |
| 27 | ...eslintPluginReactHooks.configs.recommended.rules, |
| 28 | ...eslintPluginReactRefresh.configs.vite.rules |
| 29 | } |
| 30 | }, |
| 31 | eslintConfigPrettier |
| 32 | ) |
| 33 |