11import js from "@eslint/js" ;
22import tseslint from "typescript-eslint" ;
3- import react from "eslint-plugin- react" ;
3+ import eslintReact from "@ eslint-react/eslint-plugin " ;
44import reactHooks from "eslint-plugin-react-hooks" ;
55import jsxA11y from "eslint-plugin-jsx-a11y" ;
6- import importPlugin from "eslint-plugin-import" ;
6+ import importX from "eslint-plugin-import-x " ;
77import prettier from "eslint-plugin-prettier/recommended" ;
88import globals from "globals" ;
99
@@ -19,9 +19,13 @@ export default tseslint.config(
1919 // TypeScript-ESLint recommended rules
2020 ...tseslint . configs . recommended ,
2121
22- // React plugin
23- react . configs . flat . recommended ,
24- react . configs . flat [ "jsx-runtime" ] ,
22+ // React plugin (@eslint-react: eslint-plugin-react has no ESLint 10 support)
23+ {
24+ files : [ "**/*.{js,jsx,ts,tsx}" ] ,
25+ extends : [ eslintReact . configs . recommended ] ,
26+ } ,
27+ // Let eslint-plugin-react-hooks own the hooks rules
28+ eslintReact . configs [ "disable-conflict-eslint-plugin-react-hooks" ] ,
2529
2630 // React Hooks (classic rules only — not the React Compiler preset)
2731 {
@@ -37,8 +41,8 @@ export default tseslint.config(
3741 // JSX Accessibility
3842 jsxA11y . flatConfigs . recommended ,
3943
40- // Import plugin
41- importPlugin . flatConfigs . recommended ,
44+ // Import plugin (eslint-plugin-import-x: the maintained fork with ESLint 10 support)
45+ importX . flatConfigs . recommended ,
4246
4347 // Prettier (must be last preset to override conflicting rules)
4448 prettier ,
@@ -57,10 +61,7 @@ export default tseslint.config(
5761 } ,
5862 } ,
5963 settings : {
60- react : {
61- version : "detect" ,
62- } ,
63- "import/resolver" : {
64+ "import-x/resolver" : {
6465 typescript : true ,
6566 node : true ,
6667 } ,
@@ -72,27 +73,27 @@ export default tseslint.config(
7273 files : [ "**/*.{js,ts,tsx}" ] ,
7374 rules : {
7475 "prettier/prettier" : "warn" ,
75- "react/jsx-props-no-spreading" : "off" ,
7676 "no-nested-ternary" : "off" ,
7777 "dot-notation" : "off" ,
78- "react/require-default-props" : "off" ,
7978 "@typescript-eslint/ban-ts-comment" : "warn" ,
8079 "jsx-a11y/click-events-have-key-events" : "off" ,
8180 "jsx-a11y/no-static-element-interactions" : "off" ,
82- "react/function-component-definition" : "off" ,
83- "import/no-extraneous-dependencies" : [
81+ "import-x/no-extraneous-dependencies" : [
8482 "error" ,
8583 {
8684 devDependencies : true ,
8785 optionalDependencies : true ,
8886 peerDependencies : true ,
8987 } ,
9088 ] ,
91- "react/no-unknown-property" : [ "error" , { ignore : [ "css" ] } ] ,
92- "react/prop-types" : "off" ,
9389 "default-param-last" : "off" ,
94- "import/export" : "off" ,
95- "import/prefer-default-export" : "off" ,
90+ // Rules @eslint-react adds that eslint-plugin-react had no equivalent
91+ // for. Kept off so this migration is lint-neutral; triage separately.
92+ "@eslint-react/static-components" : "off" ,
93+ "@eslint-react/set-state-in-effect" : "off" ,
94+ "@eslint-react/no-use-context" : "off" ,
95+ "import-x/export" : "off" ,
96+ "import-x/prefer-default-export" : "off" ,
9697 } ,
9798 } ,
9899) ;
0 commit comments