1
- import typescriptEslint from "@typescript-eslint/eslint-plugin" ;
2
- import globals from "globals" ;
3
- import tsParser from "@typescript-eslint/parser" ;
4
- import path from "node:path" ;
5
- import { fileURLToPath } from "node:url" ;
6
- import js from "@eslint/js" ;
7
- import { FlatCompat } from "@eslint/eslintrc" ;
8
-
9
- const __filename = fileURLToPath ( import . meta. url ) ;
10
- const __dirname = path . dirname ( __filename ) ;
11
- const compat = new FlatCompat ( {
12
- baseDirectory : __dirname ,
13
- recommendedConfig : js . configs . recommended ,
14
- allConfig : js . configs . all
15
- } ) ;
1
+ import pluginJs from '@eslint/js'
2
+ import eslintConfigPrettier from 'eslint-config-prettier'
3
+ import tseslint from 'typescript-eslint'
16
4
5
+ /** @type {import('eslint').Linter.Config[] } */
17
6
export default [
18
- ...compat . extends ( "eslint:recommended" , "plugin:@typescript-eslint/recommended" , "prettier" ) ,
19
- {
20
- plugins : {
21
- "@typescript-eslint" : typescriptEslint ,
22
- } ,
7
+ pluginJs . configs . recommended ,
8
+ ...tseslint . configs . recommended ,
9
+ {
10
+ plugins : {
11
+ '@typescript-eslint' : tseslint . plugin ,
12
+ } ,
23
13
24
- languageOptions : {
25
- globals : {
26
- ...globals . browser ,
27
- ...globals . node ,
28
- ...globals . amd ,
29
- } ,
14
+ languageOptions : {
15
+ parser : tseslint . parser ,
16
+ } ,
30
17
31
- parser : tsParser ,
32
- ecmaVersion : "latest" ,
33
- sourceType : "module" ,
34
- } ,
18
+ rules : {
19
+ 'no-console' : 'warn' ,
20
+ 'require-await' : 'error' ,
35
21
36
- rules : {
37
- "@typescript-eslint/ban-ts-comment" : "off" ,
38
- "@typescript-eslint/no-unused-vars" : "off" ,
39
- "@typescript-eslint/no-namespace" : "warn" ,
40
- } ,
22
+ '@typescript-eslint/no-unused-vars' : 'warn' ,
23
+ '@typescript-eslint/no-namespace' : 'warn' ,
24
+ '@typescript-eslint/no-empty-interface' : 'error' ,
41
25
} ,
42
- ] ;
26
+ } ,
27
+ eslintConfigPrettier ,
28
+ {
29
+ ignores : [ 'dist/*' ] ,
30
+ } ,
31
+ ]
0 commit comments