1+ import { defineConfig , globalIgnores } from "eslint/config" ;
2+ import typescriptEslint from "@typescript-eslint/eslint-plugin" ;
3+ import simpleImportSort from "eslint-plugin-simple-import-sort" ;
4+ import unusedImports from "eslint-plugin-unused-imports" ;
5+ import globals from "globals" ;
6+ import tsParser from "@typescript-eslint/parser" ;
7+ import path from "node:path" ;
8+ import { fileURLToPath } from "node:url" ;
9+ import js from "@eslint/js" ;
10+ import { FlatCompat } from "@eslint/eslintrc" ;
11+
12+ const __filename = fileURLToPath ( import . meta. url ) ;
13+ const __dirname = path . dirname ( __filename ) ;
14+ const compat = new FlatCompat ( {
15+ baseDirectory : __dirname ,
16+ recommendedConfig : js . configs . recommended ,
17+ allConfig : js . configs . all
18+ } ) ;
19+
20+ export default defineConfig ( [ globalIgnores ( [ "**/node_modules/" , "**/dist/" ] ) , {
21+ extends : compat . extends ( "eslint:recommended" , "plugin:@typescript-eslint/recommended" , "prettier" ) ,
22+
23+ plugins : {
24+ "@typescript-eslint" : typescriptEslint ,
25+ "simple-import-sort" : simpleImportSort ,
26+ "unused-imports" : unusedImports ,
27+ } ,
28+
29+ languageOptions : {
30+ globals : {
31+ ...globals . browser ,
32+ ...globals . node ,
33+ ...globals . jest ,
34+ } ,
35+
36+ parser : tsParser ,
37+ ecmaVersion : "latest" ,
38+ sourceType : "module" ,
39+ } ,
40+
41+ rules : {
42+ indent : "off" ,
43+
44+ quotes : [ "error" , "single" , {
45+ avoidEscape : true ,
46+ allowTemplateLiterals : true ,
47+ } ] ,
48+
49+ "quote-props" : [ "error" , "as-needed" ] ,
50+ semi : [ "error" , "always" ] ,
51+ "simple-import-sort/imports" : 1 ,
52+ "simple-import-sort/exports" : 1 ,
53+ "unused-imports/no-unused-imports" : 1 ,
54+
55+ "@typescript-eslint/no-unused-vars" : [ 1 , {
56+ argsIgnorePattern : "React|res|next|^_" ,
57+ } ] ,
58+
59+ "@typescript-eslint/no-explicit-any" : 0 ,
60+ "@typescript-eslint/no-var-requires" : 0 ,
61+ "no-console" : 0 ,
62+ "@typescript-eslint/ban-ts-comment" : 0 ,
63+ "prefer-const" : 0 ,
64+ "no-case-declarations" : 0 ,
65+ "no-implicit-globals" : 0 ,
66+ "@typescript-eslint/no-unsafe-declaration-merging" : 0 ,
67+ } ,
68+ } ] ) ;
0 commit comments