@@ -2,44 +2,40 @@ import react from "eslint-plugin-react";
2
2
import typescriptEslint from "@typescript-eslint/eslint-plugin" ;
3
3
import globals from "globals" ;
4
4
import tsParser from "@typescript-eslint/parser" ;
5
- import path from "node:path" ;
6
- import { fileURLToPath } from "node:url" ;
7
5
import js from "@eslint/js" ;
8
- import { FlatCompat } from "@eslint/eslintrc" ;
9
6
10
- const __filename = fileURLToPath ( import . meta. url ) ;
11
- const __dirname = path . dirname ( __filename ) ;
12
- const compat = new FlatCompat ( {
13
- baseDirectory : __dirname ,
14
- recommendedConfig : js . configs . recommended ,
15
- allConfig : js . configs . all
16
- } ) ;
17
-
18
- export default [ ...compat . extends (
19
- "eslint:recommended" ,
20
- "plugin:react/recommended" ,
21
- "plugin:@typescript-eslint/recommended" ,
22
- ) , {
23
- plugins : {
24
- react,
25
- "@typescript-eslint" : typescriptEslint ,
26
- } ,
27
-
28
- languageOptions : {
29
- globals : {
30
- ...globals . browser ,
7
+ export default [
8
+ js . configs . recommended ,
9
+ {
10
+ files : [ "**/*.{js,jsx,ts,tsx}" ] ,
11
+ plugins : {
12
+ react,
13
+ "@typescript-eslint" : typescriptEslint ,
14
+ } ,
15
+ languageOptions : {
16
+ globals : {
17
+ ...globals . browser ,
18
+ } ,
19
+ parser : tsParser ,
20
+ ecmaVersion : "latest" ,
21
+ sourceType : "module" ,
22
+ } ,
23
+ settings : {
24
+ react : {
25
+ version : "detect" ,
26
+ } ,
27
+ } ,
28
+ rules : {
29
+ ...typescriptEslint . configs . recommended . rules ,
30
+ ...react . configs . recommended . rules ,
31
31
} ,
32
-
33
- parser : tsParser ,
34
- ecmaVersion : "latest" ,
35
- sourceType : "module" ,
36
32
} ,
37
-
38
- settings : {
39
- react : {
40
- version : "detect" ,
33
+ {
34
+ files : [ "**/*.test.{js,jsx,ts,tsx}" ] ,
35
+ languageOptions : {
36
+ globals : {
37
+ ...globals . jest ,
38
+ } ,
41
39
} ,
42
40
} ,
43
-
44
- rules : { } ,
45
- } ] ;
41
+ ] ;
0 commit comments