|
1 | | -import js from '@eslint/js' |
2 | | -import globals from 'globals' |
3 | | -import reactHooks from 'eslint-plugin-react-hooks' |
4 | | -import reactRefresh from 'eslint-plugin-react-refresh' |
5 | | -import { defineConfig, globalIgnores } from 'eslint/config' |
| 1 | +import js from '@eslint/js'; |
| 2 | +import globals from 'globals'; |
| 3 | +import reactHooks from 'eslint-plugin-react-hooks'; |
| 4 | +import reactRefresh from 'eslint-plugin-react-refresh'; |
| 5 | +import tseslint from 'typescript-eslint'; |
| 6 | +import prettierPlugin from 'eslint-plugin-prettier'; |
| 7 | +import { defineConfig, globalIgnores } from 'eslint/config'; |
6 | 8 |
|
7 | 9 | export default defineConfig([ |
8 | | - globalIgnores(['dist']), |
| 10 | + globalIgnores(['dist', 'node_modules']), |
9 | 11 | { |
10 | | - files: ['**/*.{js,jsx}'], |
11 | | - extends: [ |
12 | | - js.configs.recommended, |
13 | | - reactHooks.configs['recommended-latest'], |
14 | | - reactRefresh.configs.vite, |
15 | | - ], |
| 12 | + files: ['**/*.{js,jsx,ts,tsx}'], |
16 | 13 | languageOptions: { |
17 | | - ecmaVersion: 2020, |
18 | | - globals: globals.browser, |
| 14 | + parser: tseslint.parser, |
19 | 15 | parserOptions: { |
20 | 16 | ecmaVersion: 'latest', |
21 | | - ecmaFeatures: { jsx: true }, |
22 | 17 | sourceType: 'module', |
| 18 | + ecmaFeatures: { jsx: true }, |
23 | 19 | }, |
| 20 | + globals: globals.browser, |
| 21 | + }, |
| 22 | + plugins: { |
| 23 | + '@typescript-eslint': tseslint.plugin, |
| 24 | + prettier: prettierPlugin, |
24 | 25 | }, |
| 26 | + extends: [ |
| 27 | + js.configs.recommended, |
| 28 | + ...tseslint.configs.recommended, |
| 29 | + reactHooks.configs['recommended-latest'], |
| 30 | + reactRefresh.configs.vite, |
| 31 | + ], |
25 | 32 | rules: { |
26 | | - 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }], |
| 33 | + 'no-unused-vars': 'off', |
| 34 | + '@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }], |
| 35 | + 'prettier/prettier': ['error', { singleQuote: true }], |
27 | 36 | }, |
28 | 37 | }, |
29 | | -]) |
| 38 | +]); |
0 commit comments