Skip to content

Commit 9d649de

Browse files
chore(eslint): migrate to ESLint 9 flat config format
- Add eslint.config.js with ESLint 9 flat config format - Remove deprecated .eslintrc.cjs file - Remove deprecated .eslintignore file (replaced by ignores in config) - Maintain all existing ESLint rules and configurations - Ensure compatibility with Husky 9.1.7
1 parent 7929afb commit 9d649de

File tree

3 files changed

+78
-65
lines changed

3 files changed

+78
-65
lines changed

frontend/.eslintignore

Lines changed: 0 additions & 17 deletions
This file was deleted.

frontend/.eslintrc.cjs

Lines changed: 0 additions & 48 deletions
This file was deleted.

frontend/eslint.config.js

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import js from '@eslint/js'
2+
import tsParser from '@typescript-eslint/parser'
3+
import tsPlugin from '@typescript-eslint/eslint-plugin'
4+
import react from 'eslint-plugin-react'
5+
import unusedImports from 'eslint-plugin-unused-imports'
6+
import prettier from 'eslint-plugin-prettier'
7+
import globals from 'globals'
8+
9+
export default [
10+
{
11+
ignores: [
12+
'node_modules/',
13+
'dist/',
14+
'prettier.config.cjs',
15+
'.eslintrc.cjs',
16+
'env.d.ts',
17+
'public/',
18+
'assets/',
19+
'vite-env.d.ts',
20+
'.prettierignore',
21+
'package-lock.json',
22+
'package.json',
23+
'postcss.config.cjs',
24+
'tailwind.config.cjs',
25+
'tsconfig.json',
26+
'tsconfig.node.json',
27+
'vite.config.ts',
28+
],
29+
},
30+
{
31+
files: ['**/*.{js,jsx,ts,tsx}'],
32+
languageOptions: {
33+
ecmaVersion: 'latest',
34+
sourceType: 'module',
35+
parser: tsParser,
36+
parserOptions: {
37+
ecmaFeatures: {
38+
jsx: true,
39+
},
40+
},
41+
globals: {
42+
...globals.browser,
43+
...globals.es2021,
44+
...globals.node,
45+
},
46+
},
47+
plugins: {
48+
'@typescript-eslint': tsPlugin,
49+
react,
50+
'unused-imports': unusedImports,
51+
prettier,
52+
},
53+
rules: {
54+
...js.configs.recommended.rules,
55+
...tsPlugin.configs.recommended.rules,
56+
...react.configs.recommended.rules,
57+
...prettier.configs.recommended.rules,
58+
'react/prop-types': 'off',
59+
'unused-imports/no-unused-imports': 'error',
60+
'react/react-in-jsx-scope': 'off',
61+
'no-undef': 'off',
62+
'@typescript-eslint/no-explicit-any': 'warn',
63+
'@typescript-eslint/no-unused-vars': 'warn',
64+
'@typescript-eslint/no-unused-expressions': 'warn',
65+
'prettier/prettier': [
66+
'error',
67+
{
68+
endOfLine: 'auto',
69+
},
70+
],
71+
},
72+
settings: {
73+
react: {
74+
version: 'detect',
75+
},
76+
},
77+
},
78+
]

0 commit comments

Comments
 (0)