|
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 { 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 { defineConfig, globalIgnores } from 'eslint/config'; |
| 7 | +import prettierPlugin from 'eslint-plugin-prettier'; |
| 8 | +import prettierConfig from 'eslint-config-prettier'; |
7 | 9 |
|
8 | 10 | export default defineConfig([ |
9 | | - globalIgnores(['dist']), |
| 11 | + globalIgnores(['dist', 'node_modules', 'build', 'coverage']), |
10 | 12 | { |
11 | | - files: ['**/*.{ts,tsx}'], |
| 13 | + files: ['**/*.{ts,tsx,js,jsx}'], |
12 | 14 | extends: [ |
13 | 15 | js.configs.recommended, |
14 | 16 | tseslint.configs.recommended, |
15 | 17 | reactHooks.configs['recommended-latest'], |
16 | 18 | reactRefresh.configs.vite, |
| 19 | + prettierConfig, |
17 | 20 | ], |
| 21 | + plugins: { |
| 22 | + prettier: prettierPlugin, |
| 23 | + }, |
| 24 | + rules: { |
| 25 | + ...prettierPlugin.configs.recommended.rules, |
| 26 | + }, |
18 | 27 | languageOptions: { |
19 | 28 | ecmaVersion: 2020, |
20 | | - globals: globals.browser, |
| 29 | + globals: { |
| 30 | + ...globals.browser, |
| 31 | + process: 'readonly', |
| 32 | + }, |
21 | 33 | }, |
22 | 34 | }, |
23 | | -]) |
| 35 | +]); |
0 commit comments