Merge pull request #28438 from Microsoft/maxNodeModuleJsDepth

Add affectsModuleResolution to compile options: maxNodeModuleJsDepth
This commit is contained in:
Sheetal Nandi 2018-11-09 12:29:09 -08:00 committed by GitHub
commit 89a58aee14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -777,7 +777,7 @@ namespace ts {
{ {
name: "maxNodeModuleJsDepth", name: "maxNodeModuleJsDepth",
type: "number", type: "number",
// TODO: GH#27108 affectsModuleResolution: true, affectsModuleResolution: true,
category: Diagnostics.Advanced_Options, category: Diagnostics.Advanced_Options,
description: Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files description: Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files
}, },

View file

@ -1228,11 +1228,10 @@ namespace ts.server {
setCompilerOptions(options?: CompilerOptions) { setCompilerOptions(options?: CompilerOptions) {
// Avoid manipulating the given options directly // Avoid manipulating the given options directly
const newOptions = options ? cloneCompilerOptions(options) : this.getCompilationSettings(); if (!options && !this.getCompilationSettings()) {
if (!newOptions) {
return; return;
} }
const newOptions = cloneCompilerOptions(options || this.getCompilationSettings());
if (this._isJsInferredProject && typeof newOptions.maxNodeModuleJsDepth !== "number") { if (this._isJsInferredProject && typeof newOptions.maxNodeModuleJsDepth !== "number") {
newOptions.maxNodeModuleJsDepth = 2; newOptions.maxNodeModuleJsDepth = 2;
} }