1+ import { fixupConfigRules } from "@eslint/compat" ;
2+ import { FlatCompat } from "@eslint/eslintrc" ;
3+ import js from "@eslint/js" ;
4+ import tsParser from "@typescript-eslint/parser" ;
5+ import reactRefresh from "eslint-plugin-react-refresh" ;
6+ import { defineConfig , globalIgnores } from "eslint/config" ;
7+ import globals from "globals" ;
8+ import path from "node:path" ;
9+ import { fileURLToPath } from "node:url" ;
10+
11+ const __filename = fileURLToPath ( import . meta. url ) ;
12+ const __dirname = path . dirname ( __filename ) ;
13+ const compat = new FlatCompat ( {
14+ baseDirectory : __dirname ,
15+ recommendedConfig : js . configs . recommended ,
16+ allConfig : js . configs . all
17+ } ) ;
18+
19+ export default defineConfig ( [ globalIgnores ( [ "**/dist" , "**/.eslintrc.cjs" , "**/wailsjs" ] ) , {
20+ extends : fixupConfigRules ( compat . extends (
21+ "eslint:recommended" ,
22+ "plugin:@typescript-eslint/recommended" ,
23+ "plugin:react-hooks/recommended" ,
24+ ) ) ,
25+
26+ plugins : {
27+ "react-refresh" : reactRefresh ,
28+ } ,
29+
30+ languageOptions : {
31+ globals : {
32+ ...globals . browser ,
33+ } ,
34+
35+ parser : tsParser ,
36+ } ,
37+
38+ rules : {
39+ "react-refresh/only-export-components" : [ "warn" , {
40+ allowConstantExport : true ,
41+ } ] ,
42+ } ,
43+ } ] ) ;
0 commit comments