1- import { fixupConfigRules } from "@eslint/compat" ;
2- import path from "node:path" ;
3- import { fileURLToPath } from "node:url" ;
41import js from "@eslint/js" ;
5- import { FlatCompat } from "@eslint/eslintrc" ;
2+ import tsPlugin from "@typescript-eslint/eslint-plugin" ;
3+ import tsParser from "@typescript-eslint/parser" ;
4+ import reactPlugin from "eslint-plugin-react" ;
5+ import globals from "globals" ;
66
7- const __filename = fileURLToPath ( import . meta. url ) ;
8- const __dirname = path . dirname ( __filename ) ;
9- const compat = new FlatCompat ( {
10- baseDirectory : __dirname ,
11- recommendedConfig : js . configs . recommended ,
12- allConfig : js . configs . all
13- } ) ;
14-
15- export default [ {
16- ignores : [ ] ,
17- } , ...fixupConfigRules ( compat . extends ( "react-app" ) ) ] ;
7+ export default [
8+ {
9+ ignores : [ "node_modules/**" , "dist/**" , "build/**" , "coverage/**" ]
10+ } ,
11+ {
12+ files : [ "**/*.{js,jsx,ts,tsx}" ] ,
13+ languageOptions : {
14+ ecmaVersion : 2020 ,
15+ sourceType : "module" ,
16+ globals : {
17+ ...globals . browser ,
18+ ...globals . node
19+ } ,
20+ parser : tsParser ,
21+ parserOptions : {
22+ ecmaFeatures : {
23+ jsx : true
24+ }
25+ }
26+ } ,
27+ plugins : {
28+ "@typescript-eslint" : tsPlugin ,
29+ "react" : reactPlugin
30+ } ,
31+ rules : {
32+ ...js . configs . recommended . rules ,
33+ ...tsPlugin . configs . recommended . rules ,
34+ "react/react-in-jsx-scope" : "off" ,
35+ "react/prop-types" : "off"
36+ } ,
37+ settings : {
38+ react : {
39+ version : "detect"
40+ }
41+ }
42+ }
43+ ] ;
0 commit comments