1
+ import { fixupConfigRules , fixupPluginRules } from "@eslint/compat" ;
2
+ import react from "eslint-plugin-react" ;
3
+ import _import from "eslint-plugin-import" ;
4
+ import simpleImportSort from "eslint-plugin-simple-import-sort" ;
5
+ import n from "eslint-plugin-n" ;
6
+ import typescriptEslint from "@typescript-eslint/eslint-plugin" ;
7
+ import globals from "globals" ;
8
+ import tsParser from "@typescript-eslint/parser" ;
9
+ import path from "node:path" ;
10
+ import { fileURLToPath } from "node:url" ;
11
+ import js from "@eslint/js" ;
12
+ import { FlatCompat } from "@eslint/eslintrc" ;
13
+
14
+ const __filename = fileURLToPath ( import . meta. url ) ;
15
+ const __dirname = path . dirname ( __filename ) ;
16
+ const compat = new FlatCompat ( {
17
+ baseDirectory : __dirname ,
18
+ recommendedConfig : js . configs . recommended ,
19
+ allConfig : js . configs . all
20
+ } ) ;
21
+
22
+ export default [ ...fixupConfigRules ( compat . extends (
23
+ "eslint:recommended" ,
24
+ "plugin:react/recommended" ,
25
+ "plugin:react-hooks/recommended" ,
26
+ "plugin:import/typescript" ,
27
+ "plugin:@typescript-eslint/eslint-recommended" ,
28
+ "plugin:@typescript-eslint/recommended" ,
29
+ ) ) , {
30
+ plugins : {
31
+ react : fixupPluginRules ( react ) ,
32
+ import : fixupPluginRules ( _import ) ,
33
+ "simple-import-sort" : simpleImportSort ,
34
+ n,
35
+ "@typescript-eslint" : fixupPluginRules ( typescriptEslint ) ,
36
+ } ,
37
+
38
+ languageOptions : {
39
+ globals : {
40
+ ...globals . browser ,
41
+ ...globals . node ,
42
+ } ,
43
+
44
+ parser : tsParser ,
45
+ ecmaVersion : 5 ,
46
+ sourceType : "module" ,
47
+ } ,
48
+
49
+ settings : {
50
+ react : {
51
+ pragma : "React" ,
52
+ version : "detect" ,
53
+ } ,
54
+ } ,
55
+
56
+ rules : {
57
+ "import/no-cycle" : "error" ,
58
+ "n/no-extraneous-import" : "error" ,
59
+ "@typescript-eslint/ban-ts-ignore" : "off" ,
60
+ "@typescript-eslint/ban-ts-comment" : "off" ,
61
+ "@typescript-eslint/explicit-module-boundary-types" : "off" ,
62
+ "@typescript-eslint/explicit-function-return-type" : "off" ,
63
+ "@typescript-eslint/no-use-before-define" : "off" ,
64
+ "@typescript-eslint/interface-name-prefix" : "off" ,
65
+ "@typescript-eslint/member-delimiter-style" : "off" ,
66
+ "@typescript-eslint/no-explicit-any" : "error" ,
67
+ "@typescript-eslint/no-non-null-assertion" : "error" ,
68
+ "simple-import-sort/imports" : "error" ,
69
+ "simple-import-sort/exports" : "error" ,
70
+ "react/prop-types" : "off" ,
71
+ } ,
72
+ } , {
73
+ files : [ "test/**" ] ,
74
+
75
+ rules : {
76
+ "@typescript-eslint/no-non-null-assertion" : "off" ,
77
+ } ,
78
+ } ] ;
0 commit comments