11import { fixupConfigRules } from "@eslint/compat" ;
2+ import { FlatCompat } from "@eslint/eslintrc" ;
3+ import js from "@eslint/js" ;
4+ import tsParser from "@typescript-eslint/parser" ;
25import reactRefresh from "eslint-plugin-react-refresh" ;
36import globals from "globals" ;
4- import tsParser from "@typescript-eslint/parser" ;
57import path from "node:path" ;
68import { fileURLToPath } from "node:url" ;
7- import js from "@eslint/js" ;
8- import { FlatCompat } from "@eslint/eslintrc" ;
99
1010const __filename = fileURLToPath ( import . meta. url ) ;
1111const __dirname = path . dirname ( __filename ) ;
1212const compat = new FlatCompat ( {
13- baseDirectory : __dirname ,
14- recommendedConfig : js . configs . recommended ,
15- allConfig : js . configs . all
13+ baseDirectory : __dirname ,
14+ recommendedConfig : js . configs . recommended ,
15+ allConfig : js . configs . all ,
1616} ) ;
1717
18- export default [ {
19- ignores : [ "**/dist" , "**/.eslintrc.cjs" ] ,
20- } , ...fixupConfigRules ( compat . extends (
21- "eslint:recommended" ,
22- "plugin:@typescript-eslint/recommended" ,
23- "plugin:react-hooks/recommended" ,
24- ) ) , {
25- plugins : {
26- "react-refresh" : reactRefresh ,
27- } ,
18+ export default [
19+ {
20+ ignores : [ "**/dist" , "**/.eslintrc.cjs" ] ,
21+ } ,
22+ ...fixupConfigRules (
23+ compat . extends ( "eslint:recommended" , "plugin:@typescript-eslint/recommended" , "plugin:react-hooks/recommended" ) ,
24+ ) ,
25+ {
26+ plugins : {
27+ "react-refresh" : reactRefresh ,
28+ } ,
2829
29- languageOptions : {
30- globals : {
31- ...globals . browser ,
32- } ,
30+ languageOptions : {
31+ globals : {
32+ ...globals . browser ,
33+ } ,
3334
34- parser : tsParser ,
35- } ,
35+ parser : tsParser ,
36+ } ,
3637
37- rules : {
38- "react-refresh/only-export-components" : [ "warn" , {
39- allowConstantExport : true ,
40- } ] ,
41- } ,
42- } ] ;
38+ rules : {
39+ "react-refresh/only-export-components" : [
40+ "warn" ,
41+ {
42+ allowConstantExport : true ,
43+ } ,
44+ ] ,
45+ } ,
46+ } ,
47+ ] ;
0 commit comments