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