1- import typescriptEslint from "@typescript-eslint/eslint-plugin" ;
2- import tsParser from "@typescript-eslint/parser" ;
3- import path from "node:path" ;
4- import { fileURLToPath } from "node:url" ;
51import js from "@eslint/js" ;
6- import { FlatCompat } from "@eslint/eslintrc" ;
2+ import tseslint from "typescript-eslint" ;
3+ import { defineConfig } from "eslint/config" ;
4+ import prettierConfig from "eslint-config-prettier" ;
75
8- const __filename = fileURLToPath ( import . meta. url ) ;
9- const __dirname = path . dirname ( __filename ) ;
10- const compat = new FlatCompat ( {
11- baseDirectory : __dirname ,
12- recommendedConfig : js . configs . recommended ,
13- allConfig : js . configs . all
14- } ) ;
6+ export default defineConfig ( [
7+ js . configs . recommended ,
8+ ...tseslint . configs . recommended ,
9+ // ...tseslint.configs.recommendedTypeChecked,
10+ // ...tseslint.configs.stylisticTypeChecked,
1511
16- export default [ ...compat . extends ( "plugin:@typescript-eslint/recommended" ) , {
17- plugins : {
18- "@typescript-eslint" : typescriptEslint ,
19- } ,
12+ {
13+ files : [ "**/*.ts" ] ,
2014
2115 languageOptions : {
22- parser : tsParser ,
16+ parser : tseslint . parser ,
17+ parserOptions : {
18+ project : true ,
19+ tsconfigRootDir : import . meta. dirname ,
20+ } ,
2321 } ,
24-
2522 rules : {
26- "no-var" : "off" ,
27- "prefer-rest-params" : "off" ,
28- "prefer-spread" : "off" ,
29- quotes : [ "warn" , "double" ] ,
30- semi : [ "warn" , "always" ] ,
31- "one-var-declaration-per-line" : "warn" ,
32- "@typescript-eslint/ban-ts-comment" : "off" ,
33- "@typescript-eslint/ban-types" : "off" ,
34- "@typescript-eslint/no-empty-function" : "off" ,
35- "@typescript-eslint/no-empty-interface" : "off" ,
36- "@typescript-eslint/no-explicit-any" : "off" ,
37- "@typescript-eslint/no-inferrable-types" : "off" ,
38- "@typescript-eslint/no-non-null-assertion" : "off" ,
39- "@typescript-eslint/no-unused-vars" : "off" ,
40- "@typescript-eslint/no-var-requires" : "off" ,
41-
42- "@typescript-eslint/typedef" : [ "error" , {
43- propertyDeclaration : true ,
44- } ] ,
23+ "no-var" : "off" ,
24+ "prefer-rest-params" : "off" ,
25+ "prefer-spread" : "off" ,
26+ "quotes" : [ "warn" , "double" ] ,
27+ "semi" : [ "warn" , "always" ] ,
28+ "one-var-declaration-per-line" : "warn" ,
29+ "no-constant-condition" : "warn" ,
30+ "no-empty" : "warn" ,
31+ "no-prototype-builtins" : "warn" ,
32+ "@typescript-eslint/ban-ts-comment" : "off" ,
33+ "@typescript-eslint/ban-types" : "off" ,
34+ "@typescript-eslint/no-empty-function" : "off" ,
35+ "@typescript-eslint/no-empty-interface" : "off" ,
36+ "@typescript-eslint/no-explicit-any" : "off" ,
37+ "@typescript-eslint/no-inferrable-types" : "off" ,
38+ "@typescript-eslint/no-non-null-assertion" : "off" ,
39+ "@typescript-eslint/no-unused-vars" : "off" ,
40+ "@typescript-eslint/no-var-requires" : "off" ,
41+ "@typescript-eslint/typedef" : [
42+ "error" ,
43+ {
44+ propertyDeclaration : true ,
45+ } ,
46+ ] ,
4547 } ,
46- } ] ;
48+ } ,
49+ prettierConfig ,
50+ ] ) ;
0 commit comments