|
| 1 | +import eslint from '@eslint/js'; |
| 2 | +import tseslint from '@typescript-eslint/eslint-plugin'; |
| 3 | +import tsparser from '@typescript-eslint/parser'; |
| 4 | +import react from 'eslint-plugin-react'; |
| 5 | +import reactHooks from 'eslint-plugin-react-hooks'; |
| 6 | + |
| 7 | +export default [ |
| 8 | + eslint.configs.recommended, |
| 9 | + { |
| 10 | + files: ['src/**/*.{ts,tsx}'], |
| 11 | + languageOptions: { |
| 12 | + parser: tsparser, |
| 13 | + parserOptions: { |
| 14 | + ecmaVersion: 'latest', |
| 15 | + sourceType: 'module', |
| 16 | + ecmaFeatures: { |
| 17 | + jsx: true, |
| 18 | + }, |
| 19 | + }, |
| 20 | + globals: { |
| 21 | + console: 'readonly', |
| 22 | + process: 'readonly', |
| 23 | + Buffer: 'readonly', |
| 24 | + __dirname: 'readonly', |
| 25 | + __filename: 'readonly', |
| 26 | + NodeJS: 'readonly', |
| 27 | + }, |
| 28 | + }, |
| 29 | + plugins: { |
| 30 | + '@typescript-eslint': tseslint, |
| 31 | + react: react, |
| 32 | + 'react-hooks': reactHooks, |
| 33 | + }, |
| 34 | + rules: { |
| 35 | + ...tseslint.configs.recommended.rules, |
| 36 | + ...react.configs.recommended.rules, |
| 37 | + ...reactHooks.configs.recommended.rules, |
| 38 | + 'react/react-in-jsx-scope': 'off', |
| 39 | + 'react/prop-types': 'off', |
| 40 | + '@typescript-eslint/no-explicit-any': 'warn', |
| 41 | + '@typescript-eslint/no-unused-vars': [ |
| 42 | + 'warn', |
| 43 | + { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }, |
| 44 | + ], |
| 45 | + 'no-console': 'off', |
| 46 | + }, |
| 47 | + settings: { |
| 48 | + react: { |
| 49 | + version: 'detect', |
| 50 | + }, |
| 51 | + }, |
| 52 | + }, |
| 53 | + { |
| 54 | + ignores: ['dist/**', 'node_modules/**', '*.js', '!eslint.config.js'], |
| 55 | + }, |
| 56 | +]; |
0 commit comments