1- import { fixupPluginRules } from '@eslint/compat' ;
21import reactPlugin from 'eslint-plugin-react' ;
32import reactHooksPlugin from 'eslint-plugin-react-hooks' ;
43import reactRefresh from 'eslint-plugin-react-refresh' ;
@@ -13,8 +12,9 @@ export default [
1312 reactPlugin . configs . flat . recommended ,
1413 testingLibraryPlugin . configs [ 'flat/react' ] ,
1514 {
15+ // global settings
1616 plugins : {
17- 'react-hooks' : fixupPluginRules ( reactHooksPlugin ) ,
17+ 'react-hooks' : reactHooksPlugin ,
1818 'react-refresh' : reactRefresh ,
1919 vitest : vitestPlugin ,
2020 } ,
@@ -25,16 +25,10 @@ export default [
2525 } ,
2626 } ,
2727 settings : { react : { version : 'detect' } , 'import/resolver' : { typescript : [ ] } } ,
28- rules : {
29- // https://github.com/facebook/react/issues/28313
30- ...reactHooksPlugin . configs . recommended . rules ,
31- 'react/display-name' : 0 ,
32- 'react/prop-types' : 0 ,
33- 'react-refresh/only-export-components' : 'warn' ,
34- } ,
3528 } ,
3629 {
37- files : [ '*.{ts,tsx}' ] ,
30+ // TypeScript
31+ files : [ '**/*.{ts,tsx}' ] ,
3832 languageOptions : {
3933 parserOptions : {
4034 // https://typescript-eslint.io/getting-started/typed-linting/
@@ -71,20 +65,26 @@ export default [
7165 } ,
7266 } ,
7367 {
74- files : [ './**/*.tsx' ] ,
68+ // React
69+ files : [ '**/*.tsx' ] ,
7570 rules : {
71+ // https://github.com/facebook/react/issues/28313
72+ ...reactHooksPlugin . configs . recommended . rules ,
73+ 'react/display-name' : 0 ,
74+ 'react/prop-types' : 0 ,
75+ 'react-refresh/only-export-components' : 'warn' ,
7676 'unicorn/filename-case' : 0 ,
7777 } ,
7878 } ,
7979 {
80- files : [ './ **/*.spec.ts' , './ **/*.spec.tsx' ] ,
80+ files : [ '**/*.spec.ts' , '**/*.spec.tsx' ] ,
8181 rules : {
8282 'testing-library/prefer-user-event' : 2 ,
8383 'testing-library/no-manual-cleanup' : 0 ,
8484 } ,
8585 } ,
8686 {
87- files : [ './ vitest.config.ts' ] ,
87+ files : [ 'vitest.config.ts' ] ,
8888 rules : {
8989 'import/no-default-export' : 0 ,
9090 } ,
0 commit comments