1+ import { defineConfig , globalIgnores } from "eslint/config" ;
2+ import typescriptEslint from "@typescript-eslint/eslint-plugin" ;
3+ import globals from "globals" ;
4+ import tsParser from "@typescript-eslint/parser" ;
5+ import path from "node:path" ;
6+ import { fileURLToPath } from "node:url" ;
7+ import js from "@eslint/js" ;
8+ import { FlatCompat } from "@eslint/eslintrc" ;
9+
10+ const __filename = fileURLToPath ( import . meta. url ) ;
11+ const __dirname = path . dirname ( __filename ) ;
12+ const compat = new FlatCompat ( {
13+ baseDirectory : __dirname ,
14+ recommendedConfig : js . configs . recommended ,
15+ allConfig : js . configs . all
16+ } ) ;
17+
18+ export default defineConfig ( [ globalIgnores ( [ "**/*.js" , "**/*.d.ts" ] ) , {
19+ extends : compat . extends ( "eslint:recommended" , "plugin:@typescript-eslint/recommended" ) ,
20+
21+ plugins : {
22+ "@typescript-eslint" : typescriptEslint ,
23+ } ,
24+
25+ languageOptions : {
26+ globals : {
27+ ...globals . browser ,
28+ ...globals . commonjs ,
29+ ...globals . node ,
30+ } ,
31+
32+ parser : tsParser ,
33+ ecmaVersion : "latest" ,
34+ sourceType : "commonjs" ,
35+ } ,
36+ ignores : [
37+ "*.*js" ,
38+ "*.d.ts"
39+ ] ,
40+ rules : {
41+ "@typescript-eslint/no-explicit-any" : [ "off" ] ,
42+ "@typescript-eslint/no-var-requires" : [ "off" ] ,
43+ "@typescript-eslint/no-inferrable-types" : [ "off" ] ,
44+ indent : [ "off" , "tab" ] ,
45+ "linebreak-style" : [ "warn" , "unix" ] ,
46+ "no-mixed-spaces-and-tabs" : [ "warn" , "smart-tabs" ] ,
47+
48+ quotes : [ "warn" , "single" , {
49+ allowTemplateLiterals : true ,
50+ } ] ,
51+
52+ semi : [ "warn" , "always" ] ,
53+ "comma-dangle" : [ "warn" , "always-multiline" ] ,
54+ } ,
55+ } ] ) ;
0 commit comments