|
| 1 | +import globals from 'globals'; |
| 2 | +import js from '@eslint/js'; |
| 3 | +import tsPlugin from '@typescript-eslint/eslint-plugin'; |
| 4 | +import tsParser from '@typescript-eslint/parser'; |
| 5 | +import reactPlugin from 'eslint-plugin-react'; |
| 6 | +import reactHooksPlugin from 'eslint-plugin-react-hooks'; |
| 7 | +import reactRefreshPlugin from 'eslint-plugin-react-refresh'; |
| 8 | +import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'; |
| 9 | +import importPlugin from 'eslint-plugin-import'; |
| 10 | +import prettierConfig from 'eslint-config-prettier'; |
| 11 | + |
| 12 | +export default [ |
| 13 | + { |
| 14 | + ignores: ['**/dist', '**/node_modules', '**/eslint.config.*', '**/vite.config.*', '**/tsconfig*.json'], |
| 15 | + }, |
| 16 | + js.configs.recommended, |
| 17 | + ...tsPlugin.configs['flat/recommended'], |
| 18 | + reactPlugin.configs.flat.recommended, |
| 19 | + reactPlugin.configs.flat['jsx-runtime'], |
| 20 | + reactHooksPlugin.configs.flat.recommended, |
| 21 | + jsxA11yPlugin.flatConfigs.recommended, |
| 22 | + importPlugin.flatConfigs.recommended, |
| 23 | + { |
| 24 | + files: ['**/*.{ts,tsx}'], |
| 25 | + languageOptions: { |
| 26 | + globals: { |
| 27 | + ...globals.browser, |
| 28 | + }, |
| 29 | + parser: tsParser, |
| 30 | + parserOptions: { |
| 31 | + ecmaVersion: 'latest', |
| 32 | + sourceType: 'module', |
| 33 | + ecmaFeatures: { |
| 34 | + jsx: true, |
| 35 | + }, |
| 36 | + }, |
| 37 | + }, |
| 38 | + plugins: { |
| 39 | + 'react-refresh': reactRefreshPlugin, |
| 40 | + }, |
| 41 | + settings: { |
| 42 | + react: { |
| 43 | + version: 'detect', |
| 44 | + }, |
| 45 | + 'import/resolver': { |
| 46 | + node: { |
| 47 | + extensions: ['.js', '.jsx', '.ts', '.tsx'], |
| 48 | + paths: ['src'], |
| 49 | + alias: { |
| 50 | + '@': './node_modules', |
| 51 | + }, |
| 52 | + }, |
| 53 | + }, |
| 54 | + }, |
| 55 | + rules: { |
| 56 | + 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], |
| 57 | + }, |
| 58 | + }, |
| 59 | + prettierConfig, |
| 60 | +]; |
0 commit comments