11import js from '@eslint/js' ;
2+ import eslintReact from '@eslint-react/eslint-plugin' ;
23import globals from 'globals' ;
34import tsParser from '@typescript-eslint/parser' ;
4- import reactPlugin from 'eslint-plugin-react' ;
55import reactHooksPlugin from 'eslint-plugin-react-hooks' ;
66import jsxA11yPlugin from 'eslint-plugin-jsx-a11y' ;
77import importXPlugin from 'eslint-plugin-import-x' ;
88import simpleImportSort from 'eslint-plugin-simple-import-sort' ;
99
10+ const reactFiles = [ 'src/**/*.{js,jsx}' , 'server/**/*.js' ] ;
11+
1012export default [
1113 { ignores : [ 'build/' , 'dist/' , 'node_modules/' , 'coverage/' ] } ,
1214
15+ // @eslint -react (replaces eslint-plugin-react; supports ESLint 10)
16+ { files : reactFiles , ...eslintReact . configs [ 'recommended-typescript' ] } ,
17+ { files : reactFiles , ...eslintReact . configs [ 'disable-conflict-eslint-plugin-react-hooks' ] } ,
18+ {
19+ files : reactFiles ,
20+ rules : {
21+ '@eslint-react/exhaustive-deps' : 'off' ,
22+ '@eslint-react/set-state-in-effect' : 'off' ,
23+ '@eslint-react/naming-convention-ref-name' : 'off' ,
24+ '@eslint-react/use-state' : 'off' ,
25+ '@eslint-react/no-context-provider' : 'off' ,
26+ '@eslint-react/web-api-no-leaked-timeout' : 'off' ,
27+ '@eslint-react/rules-of-hooks' : 'off' ,
28+ '@eslint-react/no-use-context' : 'off' ,
29+ '@eslint-react/purity' : 'off' ,
30+ '@eslint-react/no-forward-ref' : 'off' ,
31+ } ,
32+ } ,
33+
1334 // Shared plugins/rules for src + server
1435 {
15- files : [ 'src/**/*.{js,jsx}' , 'server/**/*.js' ] ,
36+ files : reactFiles ,
1637 languageOptions : {
1738 parser : tsParser ,
1839 ecmaVersion : 'latest' ,
@@ -21,27 +42,17 @@ export default [
2142 ecmaFeatures : { jsx : true } ,
2243 } ,
2344 } ,
24- settings : {
25- react : { version : '19.0.0' } ,
26- } ,
2745 plugins : {
28- react : reactPlugin ,
2946 'react-hooks' : reactHooksPlugin ,
3047 'jsx-a11y' : jsxA11yPlugin ,
3148 'import-x' : importXPlugin ,
3249 'simple-import-sort' : simpleImportSort ,
3350 } ,
3451 rules : {
3552 ...js . configs . recommended . rules ,
36- ...reactPlugin . configs . flat . recommended . rules ,
3753 ...reactHooksPlugin . configs . flat [ 'recommended-latest' ] . rules ,
3854 ...jsxA11yPlugin . flatConfigs . recommended . rules ,
3955 ...importXPlugin . flatConfigs . recommended . rules ,
40- // Preserved overrides from .eslintrc.json
41- 'react/no-unused-prop-types' : [ 'warn' , { skipShapeProps : true } ] ,
42- 'react/react-in-jsx-scope' : 'off' ,
43- 'react/prop-types' : 'off' ,
44- 'react/display-name' : 'off' ,
4556 'array-bracket-spacing' : [ 'warn' , 'never' ] ,
4657 'max-len' : [ 'warn' , { code : 120 } ] ,
4758 'no-plusplus' : 'error' ,
0 commit comments