@@ -4,14 +4,16 @@ import eslintPluginReactHooks from "eslint-plugin-react-hooks";
44import eslintPluginReactRefresh from "eslint-plugin-react-refresh" ;
55import babelEslintParser from "@babel/eslint-parser" ;
66import globals from "globals" ;
7+ import { defineConfig } from "eslint/config" ;
78
89import JSCONFIG from "./jsconfig.json" with { type : "json" } ;
910import JSCONFIG_NODE from "./jsconfig.node.json" with { type : "json" } ;
1011
11- export default [
12+ export default defineConfig ( [
1213 // base configuration for browser environment source files
1314 {
1415 files : JSCONFIG . include ,
16+ extends : [ eslintJs . configs . recommended ] ,
1517 languageOptions : {
1618 globals : {
1719 ...globals . browser ,
@@ -26,14 +28,12 @@ export default [
2628 } ,
2729 } ,
2830 } ,
29- rules : {
30- ...eslintJs . configs . recommended . rules ,
31- } ,
3231 } ,
3332 // base configuration for node environment source files (*.config.js, etc.)
3433 {
3534 files : JSCONFIG_NODE . include ,
3635 ignores : JSCONFIG_NODE . exclude ,
36+ extends : [ eslintJs . configs . recommended ] ,
3737 languageOptions : {
3838 globals : {
3939 ...globals . node ,
@@ -49,31 +49,21 @@ export default [
4949 } ,
5050 } ,
5151 rules : {
52- ...eslintJs . configs . recommended . rules ,
5352 "no-console" : "off" ,
5453 } ,
5554 } ,
56- // React configuration
57- {
58- files : JSCONFIG . include ,
59- ...eslintReact . configs . recommended ,
60- } ,
61- // React Hooks configuration
55+ // react specific configurations
6256 {
6357 files : JSCONFIG . include ,
58+ extends : [
59+ eslintReact . configs . recommended ,
60+ eslintPluginReactRefresh . configs . recommended ,
61+ ] ,
6462 plugins : {
6563 "react-hooks" : eslintPluginReactHooks ,
6664 } ,
67- rules : eslintPluginReactHooks . configs . recommended . rules ,
68- } ,
69- // React Refresh configuration
70- {
71- files : JSCONFIG . include ,
72- plugins : {
73- "react-refresh" : eslintPluginReactRefresh ,
74- } ,
7565 rules : {
76- "react-refresh/only-export-components" : "warn" ,
66+ ... eslintPluginReactHooks . configs . recommended . rules ,
7767 } ,
7868 } ,
79- ] ;
69+ ] ) ;
0 commit comments