mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
set the option when creating inferred projects
This commit is contained in:
@@ -1079,6 +1079,12 @@ namespace ts.server {
|
||||
project,
|
||||
fileName => this.onConfigFileAddedForInferredProject(fileName));
|
||||
|
||||
if (root.scriptKind === ScriptKind.JS || root.scriptKind === ScriptKind.JSX) {
|
||||
const options = project.getCompilerOptions();
|
||||
options.maxNodeModuleJsDepth = 2;
|
||||
project.setCompilerOptions(options);
|
||||
}
|
||||
|
||||
project.updateGraph();
|
||||
|
||||
if (!useExistingProject) {
|
||||
|
||||
@@ -169,13 +169,6 @@ namespace ts.server {
|
||||
this.compilerOptions.allowNonTsExtensions = true;
|
||||
}
|
||||
|
||||
if (this.projectKind === ProjectKind.Inferred) {
|
||||
// Add default compiler options for inferred projects here
|
||||
if (this.compilerOptions.maxNodeModuleJsDepth === undefined) {
|
||||
this.compilerOptions.maxNodeModuleJsDepth = 2;
|
||||
}
|
||||
}
|
||||
|
||||
this.setInternalCompilerOptionsForEmittingJsFiles();
|
||||
|
||||
this.lsHost = new LSHost(this.projectService.host, this, this.projectService.cancellationToken);
|
||||
|
||||
Reference in New Issue
Block a user