11import js from "@eslint/js" ;
2- import parser from "@babel/eslint-parser" ;
32import react from "@eslint-react/eslint-plugin" ;
43import reactHooks from "eslint-plugin-react-hooks" ;
54import reactRefresh from "eslint-plugin-react-refresh" ;
65import globals from "globals" ;
76
8- const GLOB_JS = [ "*.{js,jsx,cjs,mjs}" , "**/*.{js,jsx,cjs,mjs}" ] ;
9- const GLOB_SRC = GLOB_JS . map ( ( pattern ) => `src/ ${ pattern } ` ) ;
7+ import JSCONFIG from "./jsconfig.json" with { type : "json" } ;
8+ import JSCONFIG_NODE from "./jsconfig.node.json" with { type : "json" } ;
109
1110export default [
12- js . configs . recommended ,
1311 {
14- files : GLOB_JS ,
12+ files : JSCONFIG . include ,
1513 languageOptions : {
1614 globals : {
1715 ...globals . browser ,
1816 } ,
19- parser,
2017 parserOptions : {
21- requireConfigFile : false ,
22- babelOptions : {
23- babelrc : false ,
24- configFile : false ,
25- presets : [ "@babel/preset-env" , "@babel/preset-react" ] ,
18+ ecmaFeatures : {
19+ jsx : true ,
2620 } ,
2721 } ,
2822 } ,
2923 } ,
3024 {
31- files : GLOB_SRC ,
25+ files : JSCONFIG . include ,
3226 ...react . configs . recommended ,
3327 } ,
3428 {
35- files : GLOB_SRC ,
29+ files : JSCONFIG . include ,
3630 plugins : {
3731 "react-hooks" : reactHooks ,
3832 } ,
3933 rules : reactHooks . configs . recommended . rules ,
4034 } ,
4135 {
42- files : GLOB_SRC ,
36+ files : JSCONFIG . include ,
4337 plugins : {
4438 "react-refresh" : reactRefresh ,
4539 } ,
@@ -48,11 +42,16 @@ export default [
4842 } ,
4943 } ,
5044 {
51- ignores : [
52- "node_modules" ,
53- "dist" ,
54- "eslint.config.js" ,
55- "eslint.config.d.ts" ,
56- ] ,
45+ files : JSCONFIG_NODE . include ,
46+ ignores : JSCONFIG_NODE . exclude ,
47+ languageOptions : {
48+ globals : {
49+ ...globals . node ,
50+ } ,
51+ } ,
52+ rules : {
53+ ...js . configs . recommended . rules ,
54+ "no-console" : "off" ,
55+ } ,
5756 } ,
5857] ;
0 commit comments