1
1
import path from 'node:path'
2
2
3
- import { withoutProjectParserOptions } from '@typescript-eslint/typescript-estree'
3
+ // import { withoutProjectParserOptions } from '@typescript-eslint/typescript-estree'
4
4
import type { TSESLint , TSESTree } from '@typescript-eslint/utils'
5
5
import debug from 'debug'
6
6
@@ -13,6 +13,19 @@ import type {
13
13
14
14
import { moduleRequire } from './module-require'
15
15
16
+ // https://github.com/nuxt/eslint/issues/494
17
+ function withoutProjectParserOptions (
18
+ opts : TSESLint . ParserOptions ,
19
+ ) : Exclude <
20
+ TSESLint . ParserOptions ,
21
+ 'EXPERIMENTAL_useProjectService' | 'project' | 'projectService'
22
+ > {
23
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- The variables are meant to be omitted
24
+ const { EXPERIMENTAL_useProjectService, project, projectService, ...rest } =
25
+ opts
26
+ return rest
27
+ }
28
+
16
29
const log = debug ( 'eslint-plugin-import-x:parse' )
17
30
18
31
function keysFromParser (
@@ -90,9 +103,7 @@ export function parse(
90
103
// "project" or "projects" in parserOptions. Removing these options means the parser will
91
104
// only parse one file in isolate mode, which is much, much faster.
92
105
// https://github.com/import-js/eslint-plugin-import/issues/1408#issuecomment-509298962
93
- parserOptions = withoutProjectParserOptions (
94
- parserOptions ,
95
- ) as TSESLint . ParserOptions
106
+ parserOptions = withoutProjectParserOptions ( parserOptions )
96
107
97
108
// require the parser relative to the main module (i.e., ESLint)
98
109
const parser =
0 commit comments