at main 1.4 kB view raw
1import js from '@eslint/js'; 2import typescript from '@typescript-eslint/eslint-plugin'; 3import typescriptParser from '@typescript-eslint/parser'; 4import react from 'eslint-plugin-react'; 5import reactHooks from 'eslint-plugin-react-hooks'; 6import reactRefresh from 'eslint-plugin-react-refresh'; 7import globals from 'globals'; 8 9export default [ 10 { ignores: ['dist'] }, 11 { 12 files: ['**/*.{js,jsx,ts,tsx}'], 13 languageOptions: { 14 ecmaVersion: 2020, 15 globals: { 16 ...globals.browser, 17 ...globals.node, 18 }, 19 parser: typescriptParser, 20 parserOptions: { 21 ecmaVersion: 'latest', 22 ecmaFeatures: { jsx: true }, 23 sourceType: 'module', 24 project: './tsconfig.eslint.json', 25 tsconfigRootDir: process.cwd(), 26 }, 27 }, 28 settings: { react: { version: '18.3' } }, 29 plugins: { 30 react, 31 'react-hooks': reactHooks, 32 'react-refresh': reactRefresh, 33 '@typescript-eslint': typescript, 34 }, 35 rules: { 36 ...js.configs.recommended.rules, 37 ...react.configs.recommended.rules, 38 ...react.configs['jsx-runtime'].rules, 39 ...reactHooks.configs.recommended.rules, 40 ...typescript.configs.recommended.rules, 41 'react/jsx-no-target-blank': 'off', 42 'react-refresh/only-export-components': [ 43 'warn', 44 { allowConstantExport: true }, 45 ], 46 }, 47 }, 48];