Skip to content

Commit ac11f62

Browse files
authored
refactor: isolate parsing w/ typescript-eslint v8 (#130)
1 parent 4ac2b98 commit ac11f62

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"eslint": "^8.57.0 || ^9.0.0"
4949
},
5050
"dependencies": {
51+
"@typescript-eslint/typescript-estree": "^8.1.0",
5152
"@typescript-eslint/utils": "^8.1.0",
5253
"debug": "^4.3.4",
5354
"doctrine": "^3.0.0",

src/utils/parse.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import path from 'node:path'
22

3+
import { withoutProjectParserOptions } from '@typescript-eslint/typescript-estree'
34
import type { TSESLint, TSESTree } from '@typescript-eslint/utils'
45
import debug from 'debug'
56

@@ -89,13 +90,9 @@ export function parse(
8990
// "project" or "projects" in parserOptions. Removing these options means the parser will
9091
// only parse one file in isolate mode, which is much, much faster.
9192
// https://github.com/import-js/eslint-plugin-import/issues/1408#issuecomment-509298962
92-
93-
// TODO: prefer https://github.com/typescript-eslint/typescript-eslint/pull/9233 when typescript-eslint v8
94-
// become stable
95-
delete parserOptions.EXPERIMENTAL_useProjectService
96-
delete parserOptions.projectService
97-
delete parserOptions.project
98-
delete parserOptions.projects
93+
parserOptions = withoutProjectParserOptions(
94+
parserOptions,
95+
) as TSESLint.ParserOptions
9996

10097
// require the parser relative to the main module (i.e., ESLint)
10198
const parser =

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2421,7 +2421,7 @@
24212421
semver "^7.3.7"
24222422
tsutils "^3.21.0"
24232423

2424-
"@typescript-eslint/typescript-estree@8.1.0":
2424+
"@typescript-eslint/typescript-estree@8.1.0", "@typescript-eslint/typescript-estree@^8.1.0":
24252425
version "8.1.0"
24262426
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.1.0.tgz#c44e5667683c0bb5caa43192e27de6a994f4e4c4"
24272427
integrity sha512-NTHhmufocEkMiAord/g++gWKb0Fr34e9AExBRdqgWdVBaKoei2dIyYKD9Q0jBnvfbEA5zaf8plUFMUH6kQ0vGg==

0 commit comments

Comments
 (0)