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" ;
5
- import js from "@eslint/js" ;
6
- import { FlatCompat } from "@eslint/eslintrc" ;
7
-
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
- } ) ;
15
-
16
- export default [ {
17
- ignores : [ "**/node_modules" , "**/dist" , "**/*.js" ] ,
18
- } , ...compat . extends (
19
- "eslint:recommended" ,
20
- "plugin:@typescript-eslint/eslint-recommended" ,
21
- "plugin:@typescript-eslint/recommended" ,
22
- ) , {
23
- files : [ "**/*.ts" , "**/*.tsx" ] ,
24
-
25
- plugins : {
26
- "@typescript-eslint" : typescriptEslint ,
27
- } ,
28
-
1
+ import eslint from '@eslint/js' ;
2
+ import tseslint from 'typescript-eslint' ;
3
+ export default tseslint . config (
4
+ {
5
+ ignores : [
6
+ '**/coverage' ,
7
+ '**/dist' ,
8
+ '**/__fixtures__' ,
9
+ '**/jest.config.js' ,
10
+ '**/jest.config.base.js' ,
11
+ 'examples' ,
12
+ 'packages/canonical-json' ,
13
+ 'eslint.config.mjs' ,
14
+ ] ,
15
+ } ,
16
+ eslint . configs . recommended ,
17
+ tseslint . configs . recommendedTypeChecked ,
18
+ {
29
19
languageOptions : {
30
- parser : tsParser ,
31
- sourceType : "module" ,
32
-
33
- parserOptions : {
34
- project : "tsconfig.base.json" ,
35
- } ,
20
+ parserOptions : {
21
+ projectService : [ './packages/*/tsconfig.json' ] ,
22
+ tsconfigRootDir : import . meta. dirname ,
23
+ } ,
36
24
} ,
37
-
38
25
rules : {
39
- "@typescript-eslint/require-await" : "error" ,
40
- "@typescript-eslint/no-unused-vars" : [ "error" , { "caughtErrors" : "none" } ]
26
+ "@typescript-eslint/no-base-to-string" : "off" ,
27
+ "@typescript-eslint/no-unused-vars" : [ "error" , { "caughtErrors" : "none" } ] ,
28
+ "@typescript-eslint/require-await" : "error" ,
29
+ "@typescript-eslint/restrict-template-expressions" : "off" ,
41
30
} ,
42
- } ] ;
31
+ }
32
+ ) ;
0 commit comments