@typescript-eslint/typescript-estree
Advanced tools
Comparing version
@@ -22,5 +22,6 @@ "use strict"; | ||
function createProjectService(optionsRaw, jsDocParsingMode, tsconfigRootDir) { | ||
const optionsRawObject = typeof optionsRaw === 'object' ? optionsRaw : {}; | ||
const options = { | ||
defaultProject: 'tsconfig.json', | ||
...(typeof optionsRaw === 'object' && optionsRaw), | ||
...optionsRawObject, | ||
}; | ||
@@ -105,10 +106,14 @@ (0, validateDefaultProjectForFilesGlob_1.validateDefaultProjectForFilesGlob)(options.allowDefaultProject); | ||
catch (error) { | ||
throw new Error(`Could not read project service default project '${options.defaultProject}': ${error.message}`); | ||
if (optionsRawObject.defaultProject) { | ||
throw new Error(`Could not read project service default project '${options.defaultProject}': ${error.message}`); | ||
} | ||
} | ||
service.setCompilerOptionsForInferredProjects( | ||
// NOTE: The inferred projects API is not intended for source files when a tsconfig | ||
// exists. There is no API that generates an InferredProjectCompilerOptions suggesting | ||
// it is meant for hard coded options passed in. Hard asserting as a work around. | ||
// See https://github.com/microsoft/TypeScript/blob/27bcd4cb5a98bce46c9cdd749752703ead021a4b/src/server/protocol.ts#L1904 | ||
configFile.options); | ||
if (configFile) { | ||
service.setCompilerOptionsForInferredProjects( | ||
// NOTE: The inferred projects API is not intended for source files when a tsconfig | ||
// exists. There is no API that generates an InferredProjectCompilerOptions suggesting | ||
// it is meant for hard coded options passed in. Hard asserting as a work around. | ||
// See https://github.com/microsoft/TypeScript/blob/27bcd4cb5a98bce46c9cdd749752703ead021a4b/src/server/protocol.ts#L1904 | ||
configFile.options); | ||
} | ||
return { | ||
@@ -115,0 +120,0 @@ allowDefaultProject: options.allowDefaultProject, |
{ | ||
"name": "@typescript-eslint/typescript-estree", | ||
"version": "8.5.1-alpha.9", | ||
"version": "8.5.1-alpha.10", | ||
"description": "A parser that converts TypeScript source code into an ESTree compatible form", | ||
@@ -57,4 +57,4 @@ "files": [ | ||
"dependencies": { | ||
"@typescript-eslint/types": "8.5.1-alpha.9", | ||
"@typescript-eslint/visitor-keys": "8.5.1-alpha.9", | ||
"@typescript-eslint/types": "8.5.1-alpha.10", | ||
"@typescript-eslint/visitor-keys": "8.5.1-alpha.10", | ||
"debug": "^4.3.4", | ||
@@ -61,0 +61,0 @@ "fast-glob": "^3.3.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
586910
0.05%7556
0.07%+ Added
+ Added
- Removed
- Removed