Skip to content

Commit e4ae667

Browse files
committed
Switch to ESLint projectService
1 parent 6be9c60 commit e4ae667

File tree

6 files changed

+31
-67
lines changed

6 files changed

+31
-67
lines changed

eslint.config.mjs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ import _import from 'eslint-plugin-import'
99
import jest from 'eslint-plugin-jest'
1010
import prettier from 'eslint-plugin-prettier'
1111
import globals from 'globals'
12-
import path from 'node:path'
13-
import { fileURLToPath } from 'node:url'
1412

15-
const __filename = fileURLToPath(import.meta.url)
16-
const __dirname = path.dirname(__filename)
1713
const compat = new FlatCompat({
18-
baseDirectory: __dirname,
14+
baseDirectory: import.meta.dirname,
1915
recommendedConfig: js.configs.recommended,
2016
allConfig: js.configs.all
2117
})
@@ -52,16 +48,24 @@ export default [
5248
sourceType: 'module',
5349

5450
parserOptions: {
55-
project: ['tsconfig.eslint.json'],
56-
tsconfigRootDir: __dirname
51+
projectService: {
52+
allowDefaultProject: [
53+
'__fixtures__/*.ts',
54+
'__tests__/*.ts',
55+
'eslint.config.mjs',
56+
'jest.config.js',
57+
'rollup.config.ts'
58+
]
59+
},
60+
tsconfigRootDir: import.meta.dirname
5761
}
5862
},
5963

6064
settings: {
6165
'import/resolver': {
6266
typescript: {
6367
alwaysTryTypes: true,
64-
project: 'tsconfig.eslint.json'
68+
project: 'tsconfig.json'
6569
}
6670
}
6771
},

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default {
3131
'^.+\\.ts$': [
3232
'ts-jest',
3333
{
34-
tsconfig: 'tsconfig.eslint.json',
34+
tsconfig: 'tsconfig.json',
3535
useESM: true
3636
}
3737
]

package-lock.json

Lines changed: 1 addition & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsconfig.base.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

tsconfig.eslint.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

tsconfig.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
{
22
"$schema": "https://json.schemastore.org/tsconfig",
3-
"extends": "./tsconfig.base.json",
43
"compilerOptions": {
4+
"allowSyntheticDefaultImports": true,
5+
"declaration": false,
6+
"declarationMap": false,
7+
"esModuleInterop": true,
8+
"forceConsistentCasingInFileNames": true,
9+
"isolatedModules": true,
10+
"lib": ["ES2022"],
511
"module": "NodeNext",
612
"moduleResolution": "NodeNext",
7-
"outDir": "./dist"
13+
"newLine": "lf",
14+
"noImplicitAny": true,
15+
"noUnusedLocals": true,
16+
"noUnusedParameters": false,
17+
"outDir": "./dist",
18+
"pretty": true,
19+
"resolveJsonModule": true,
20+
"strict": true,
21+
"strictNullChecks": true,
22+
"target": "ES2022"
823
},
924
"exclude": ["__fixtures__", "__tests__", "coverage", "dist", "node_modules"],
1025
"include": ["src"]

0 commit comments

Comments
 (0)