11import js from '@eslint/js' ;
22import globals from 'globals' ;
3- import react from 'eslint-plugin- react' ;
3+ import eslintReact from '@ eslint-react/eslint-plugin ' ;
44import reactHooks from 'eslint-plugin-react-hooks' ;
55import reactRefresh from 'eslint-plugin-react-refresh' ;
6+ import tseslint from 'typescript-eslint' ;
67
78export default [
89 {
@@ -19,25 +20,33 @@ export default [
1920 {
2021 files : [ '**/*.{js,jsx}' ] ,
2122 languageOptions : {
23+ parser : tseslint . parser ,
2224 ecmaVersion : 2022 ,
2325 globals : { ...globals . browser , ...globals . node } ,
2426 parserOptions : {
2527 ecmaFeatures : { jsx : true } ,
2628 sourceType : 'module' ,
2729 } ,
2830 } ,
29- settings : { react : { version : 'detect' } } ,
31+ } ,
32+ {
33+ files : [ '**/*.{js,jsx}' ] ,
34+ ...eslintReact . configs . recommended ,
35+ } ,
36+ {
37+ files : [ '**/*.{js,jsx}' ] ,
3038 plugins : {
31- react,
3239 'react-hooks' : reactHooks ,
3340 'react-refresh' : reactRefresh ,
3441 } ,
3542 rules : {
36- ...react . configs . recommended . rules ,
37- ...react . configs [ 'jsx-runtime' ] . rules ,
3843 ...reactHooks . configs . recommended . rules ,
39- 'react/prop-types' : 'off' ,
4044 'react-refresh/only-export-components' : [ 'warn' , { allowConstantExport : true } ] ,
45+ // Opinionated @eslint -react rules left off to keep this migration behaviour-neutral;
46+ // revisit if we want to enforce them.
47+ '@eslint-react/no-array-index-key' : 'off' ,
48+ '@eslint-react/use-state' : 'off' ,
49+ '@eslint-react/set-state-in-effect' : 'off' ,
4150 } ,
4251 } ,
4352 {
0 commit comments