diff --git a/.gitignore b/.gitignore index e61c3510e3709..bbb2e62c8bcc5 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ internal/ **/.vscode !**/.vscode/tasks.json !tests/cases/projects/projectOption/**/node_modules +!tests/cases/projects/NodeModulesSearch/**/* diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 1c1b51f2a2917..6af62914502a7 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -384,6 +384,11 @@ namespace ts { type: "boolean", description: Diagnostics.Do_not_emit_use_strict_directives_in_module_output }, + { + name: "maxNodeModuleJsDepth", + type: "number", + description: Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files + }, { name: "listEmittedFiles", type: "boolean" diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e2ad55f95ef2f..0ee1818ee5743 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2804,7 +2804,14 @@ "category": "Message", "code": 6135 }, - + "The maximum dependency depth to search under node_modules and load JavaScript files": { + "category": "Message", + "code": 6136 + }, + "No types specified in 'package.json' but 'allowJs' is set, so returning 'main' value of '{0}'": { + "category": "Message", + "code": 6137 + }, "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", "code": 7005 diff --git a/src/compiler/program.ts b/src/compiler/program.ts index a01f3a4c5b240..fdc39e1eb353d 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -130,10 +130,10 @@ namespace ts { } function tryReadTypesSection(packageJsonPath: string, baseDirectory: string, state: ModuleResolutionState): string { - let jsonContent: { typings?: string, types?: string }; + let jsonContent: { typings?: string, types?: string, main?: string }; try { const jsonText = state.host.readFile(packageJsonPath); - jsonContent = jsonText ? <{ typings?: string, types?: string }>JSON.parse(jsonText) : {}; + jsonContent = jsonText ? <{ typings?: string, types?: string, main?: string }>JSON.parse(jsonText) : {}; } catch (e) { // gracefully handle if readFile fails or returns not JSON @@ -173,6 +173,14 @@ namespace ts { } return typesFilePath; } + // Use the main module for inferring types if no types package specified and the allowJs is set + if (state.compilerOptions.allowJs && jsonContent.main && typeof jsonContent.main === "string") { + if (state.traceEnabled) { + trace(state.host, Diagnostics.No_types_specified_in_package_json_but_allowJs_is_set_so_returning_main_value_of_0, jsonContent.main); + } + const mainFilePath = normalizePath(combinePaths(baseDirectory, jsonContent.main)); + return mainFilePath; + } return undefined; } @@ -610,7 +618,7 @@ namespace ts { failedLookupLocations, supportedExtensions, state); let isExternalLibraryImport = false; - if (!resolvedFileName) { + if (!resolvedFileName) { if (moduleHasNonRelativeName(moduleName)) { if (traceEnabled) { trace(host, Diagnostics.Loading_module_0_from_node_modules_folder, moduleName); @@ -740,12 +748,13 @@ namespace ts { const nodeModulesFolder = combinePaths(directory, "node_modules"); const nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); const candidate = normalizePath(combinePaths(nodeModulesFolder, moduleName)); - // Load only typescript files irrespective of allowJs option if loading from node modules - let result = loadModuleFromFile(candidate, supportedTypeScriptExtensions, failedLookupLocations, !nodeModulesFolderExists, state); + const supportedExtensions = getSupportedExtensions(state.compilerOptions); + + let result = loadModuleFromFile(candidate, supportedExtensions, failedLookupLocations, !nodeModulesFolderExists, state); if (result) { return result; } - result = loadNodeModuleFromDirectory(supportedTypeScriptExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); + result = loadNodeModuleFromDirectory(supportedExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); if (result) { return result; } @@ -1057,6 +1066,23 @@ namespace ts { let resolvedTypeReferenceDirectives: Map = {}; let fileProcessingDiagnostics = createDiagnosticCollection(); + // The below settings are to track if a .js file should be add to the program if loaded via searching under node_modules. + // This works as imported modules are discovered recursively in a depth first manner, specifically: + // - For each root file, findSourceFile is called. + // - This calls processImportedModules for each module imported in the source file. + // - This calls resolveModuleNames, and then calls findSourceFile for each resolved module. + // As all these operations happen - and are nested - within the createProgram call, they close over the below variables. + // The current resolution depth is tracked by incrementing/decrementing as the depth first search progresses. + const maxNodeModulesJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 2; + let currentNodeModulesJsDepth = 0; + + // If a module has some of its imports skipped due to being at the depth limit under node_modules, then track + // this, as it may be imported at a shallower depth later, and then it will need its skipped imports processed. + const modulesWithElidedImports: Map = {}; + + // Track source files that are JavaScript files found by searching under node_modules, as these shouldn't be compiled. + const jsFilesFoundSearchingNodeModules: Map = {}; + const start = new Date().getTime(); host = host || createCompilerHost(options); @@ -1211,6 +1237,7 @@ namespace ts { (oldOptions.rootDir !== options.rootDir) || (oldOptions.configFilePath !== options.configFilePath) || (oldOptions.baseUrl !== options.baseUrl) || + (oldOptions.maxNodeModuleJsDepth !== options.maxNodeModuleJsDepth) || !arrayIsEqualTo(oldOptions.typeRoots, oldOptions.typeRoots) || !arrayIsEqualTo(oldOptions.rootDirs, options.rootDirs) || !mapIsEqualTo(oldOptions.paths, options.paths)) { @@ -1335,6 +1362,7 @@ namespace ts { getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, + getFilesFromNodeModules: () => jsFilesFoundSearchingNodeModules, writeFile: writeFileCallback || ( (fileName, data, writeByteOrderMark, onError, sourceFiles) => host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles)), isEmitBlocked, @@ -1869,6 +1897,14 @@ namespace ts { reportFileNamesDifferOnlyInCasingError(fileName, file.fileName, refFile, refPos, refEnd); } + // See if we need to reprocess the imports due to prior skipped imports + if (file && lookUp(modulesWithElidedImports, file.path)) { + if (currentNodeModulesJsDepth < maxNodeModulesJsDepth) { + modulesWithElidedImports[file.path] = false; + processImportedModules(file, getDirectoryPath(fileName)); + } + } + return file; } @@ -2007,16 +2043,38 @@ namespace ts { for (let i = 0; i < moduleNames.length; i++) { const resolution = resolutions[i]; setResolvedModule(file, moduleNames[i], resolution); + const resolvedPath = resolution ? toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName) : undefined; + // add file to program only if: // - resolution was successful // - noResolve is falsy // - module name comes from the list of imports - const shouldAddFile = resolution && - !options.noResolve && - i < file.imports.length; + // - it's not a top level JavaScript module that exceeded the search max + const isJsFileUnderNodeModules = resolution && resolution.isExternalLibraryImport && + hasJavaScriptFileExtension(resolution.resolvedFileName); + + if (isJsFileUnderNodeModules) { + jsFilesFoundSearchingNodeModules[resolvedPath] = true; + currentNodeModulesJsDepth++; + } + + const elideImport = isJsFileUnderNodeModules && currentNodeModulesJsDepth > maxNodeModulesJsDepth; + const shouldAddFile = resolution && !options.noResolve && i < file.imports.length && !elideImport; + + if (elideImport) { + modulesWithElidedImports[file.path] = true; + } + else if (shouldAddFile) { + findSourceFile(resolution.resolvedFileName, + resolvedPath, + /*isDefaultLib*/ false, /*isReference*/ false, + file, + skipTrivia(file.text, file.imports[i].pos), + file.imports[i].end); + } - if (shouldAddFile) { - findSourceFile(resolution.resolvedFileName, toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), /*isDefaultLib*/ false, /*isReference*/ false, file, skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); + if (isJsFileUnderNodeModules) { + currentNodeModulesJsDepth--; } } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 1a94ef200ba2d..47619c6ca1171 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2533,6 +2533,7 @@ namespace ts { declaration?: boolean; declarationDir?: string; /* @internal */ diagnostics?: boolean; + disableSizeLimit?: boolean; emitBOM?: boolean; emitDecoratorMetadata?: boolean; experimentalDecorators?: boolean; @@ -2548,6 +2549,7 @@ namespace ts { /*@internal*/listFiles?: boolean; locale?: string; mapRoot?: string; + maxNodeModuleJsDepth?: number; module?: ModuleKind; moduleResolution?: ModuleResolutionKind; newLine?: NewLineKind; @@ -2586,7 +2588,6 @@ namespace ts { /* @internal */ suppressOutputPathCheck?: boolean; target?: ScriptTarget; traceResolution?: boolean; - disableSizeLimit?: boolean; types?: string[]; /** Paths used to used to compute primary types search locations */ typeRoots?: string[]; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 99e158e6ab7a6..e8f2832cd592e 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -35,6 +35,9 @@ namespace ts { export interface EmitHost extends ScriptReferenceHost { getSourceFiles(): SourceFile[]; + /* @internal */ + getFilesFromNodeModules(): Map; + getCommonSourceDirectory(): string; getCanonicalFileName(fileName: string): string; getNewLine(): string; @@ -2274,8 +2277,10 @@ namespace ts { } else { const sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile]; + const nodeModulesFiles = host.getFilesFromNodeModules(); for (const sourceFile of sourceFiles) { - if (!isDeclarationFile(sourceFile)) { + // Don't emit if source file is a declaration file, or was located under node_modules + if (!isDeclarationFile(sourceFile) && !lookUp(nodeModulesFiles, sourceFile.path)) { onSingleFileEmit(host, sourceFile); } } @@ -2307,11 +2312,14 @@ namespace ts { } function onBundledEmit(host: EmitHost) { - // Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified - const bundledSources = filter(host.getSourceFiles(), sourceFile => - !isDeclarationFile(sourceFile) // Not a declaration file - && (!isExternalModule(sourceFile) || !!getEmitModuleKind(options))); // and not a module, unless module emit enabled - + // Can emit only sources that are not declaration file and are either non module code or module with + // --module or --target es6 specified. Files included by searching under node_modules are also not emitted. + const nodeModulesFiles = host.getFilesFromNodeModules(); + const bundledSources = filter(host.getSourceFiles(), + sourceFile => !isDeclarationFile(sourceFile) && + !lookUp(nodeModulesFiles, sourceFile.path) && + (!isExternalModule(sourceFile) || + !!getEmitModuleKind(options))); if (bundledSources.length) { const jsFilePath = options.outFile || options.out; const emitFileNames: EmitFileNames = { diff --git a/src/harness/runnerbase.ts b/src/harness/runnerbase.ts index a16eddcbeec8d..346382b7a5721 100644 --- a/src/harness/runnerbase.ts +++ b/src/harness/runnerbase.ts @@ -31,18 +31,12 @@ abstract class RunnerBase { /** Replaces instances of full paths with fileNames only */ static removeFullPaths(path: string) { - let fixedPath = path; - - // full paths either start with a drive letter or / for *nix, shouldn't have \ in the path at this point - const fullPath = /(\w+:|\/)?([\w+\-\.]|\/)*\.tsx?/g; - const fullPathList = fixedPath.match(fullPath); - if (fullPathList) { - fullPathList.forEach((match: string) => fixedPath = fixedPath.replace(match, Harness.Path.getFileName(match))); - } + // If its a full path (starts with "C:" or "/") replace with just the filename + let fixedPath = /^(\w:|\/)/.test(path) ? Harness.Path.getFileName(path) : path; // when running in the browser the 'full path' is the host name, shows up in error baselines const localHost = /http:\/localhost:\d+/g; fixedPath = fixedPath.replace(localHost, ""); return fixedPath; } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/declarationEmit_invalidReference2.errors.txt b/tests/baselines/reference/declarationEmit_invalidReference2.errors.txt index 1f3960a87ab83..9d480419022c9 100644 --- a/tests/baselines/reference/declarationEmit_invalidReference2.errors.txt +++ b/tests/baselines/reference/declarationEmit_invalidReference2.errors.txt @@ -4,5 +4,5 @@ tests/cases/compiler/declarationEmit_invalidReference2.ts(1,1): error TS6053: Fi ==== tests/cases/compiler/declarationEmit_invalidReference2.ts (1 errors) ==== /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'invalid.ts' not found. +!!! error TS6053: File 'tests/cases/compiler/invalid.ts' not found. var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/declarationFileOverwriteError.errors.txt b/tests/baselines/reference/declarationFileOverwriteError.errors.txt index a12c60482e904..1974976dee1fe 100644 --- a/tests/baselines/reference/declarationFileOverwriteError.errors.txt +++ b/tests/baselines/reference/declarationFileOverwriteError.errors.txt @@ -1,7 +1,7 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. -!!! error TS5055: Cannot write file 'a.d.ts' because it would overwrite input file. +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. ==== tests/cases/compiler/a.d.ts (0 errors) ==== declare class c { diff --git a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt index 02251900345a4..658465de9c2d2 100644 --- a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt +++ b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt @@ -1,7 +1,7 @@ error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file. -!!! error TS5055: Cannot write file 'out.d.ts' because it would overwrite input file. +!!! error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file. ==== tests/cases/compiler/out.d.ts (0 errors) ==== declare class c { diff --git a/tests/baselines/reference/exportStarFromEmptyModule.errors.txt b/tests/baselines/reference/exportStarFromEmptyModule.errors.txt index 9d781da270792..8ca80fae40870 100644 --- a/tests/baselines/reference/exportStarFromEmptyModule.errors.txt +++ b/tests/baselines/reference/exportStarFromEmptyModule.errors.txt @@ -14,7 +14,7 @@ tests/cases/compiler/exportStarFromEmptyModule_module4.ts(4,5): error TS2339: Pr ==== tests/cases/compiler/exportStarFromEmptyModule_module3.ts (1 errors) ==== export * from "./exportStarFromEmptyModule_module2"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2306: File 'exportStarFromEmptyModule_module2.ts' is not a module. +!!! error TS2306: File 'tests/cases/compiler/exportStarFromEmptyModule_module2.ts' is not a module. export * from "./exportStarFromEmptyModule_module1"; export class A { diff --git a/tests/baselines/reference/importNonExternalModule.errors.txt b/tests/baselines/reference/importNonExternalModule.errors.txt index fb8294c5c0343..96f8959565c8a 100644 --- a/tests/baselines/reference/importNonExternalModule.errors.txt +++ b/tests/baselines/reference/importNonExternalModule.errors.txt @@ -4,7 +4,7 @@ tests/cases/conformance/externalModules/foo_1.ts(1,22): error TS2306: File 'test ==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== import foo = require("./foo_0"); ~~~~~~~~~ -!!! error TS2306: File 'foo_0.ts' is not a module. +!!! error TS2306: File 'tests/cases/conformance/externalModules/foo_0.ts' is not a module. // Import should fail. foo_0 not an external module if(foo.answer === 42){ diff --git a/tests/baselines/reference/invalidTripleSlashReference.errors.txt b/tests/baselines/reference/invalidTripleSlashReference.errors.txt index 40d75004a99d8..1de5ecaaae157 100644 --- a/tests/baselines/reference/invalidTripleSlashReference.errors.txt +++ b/tests/baselines/reference/invalidTripleSlashReference.errors.txt @@ -5,10 +5,10 @@ tests/cases/compiler/invalidTripleSlashReference.ts(2,1): error TS6053: File 'te ==== tests/cases/compiler/invalidTripleSlashReference.ts (2 errors) ==== /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'filedoesnotexist.ts' not found. +!!! error TS6053: File 'tests/cases/compiler/filedoesnotexist.ts' not found. /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'otherdoesnotexist.d.ts' not found. +!!! error TS6053: File 'tests/cases/compiler/otherdoesnotexist.d.ts' not found. // this test doesn't actually give the errors you want due to the way the compiler reports errors var x = 1; \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt b/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt index 84900bccc8848..9e9c2adb0efa2 100644 --- a/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt @@ -1,7 +1,7 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. -!!! error TS5055: Cannot write file 'a.d.ts' because it would overwrite input file. +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt index 826f906538fd1..10c7b8c90ddad 100644 --- a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt @@ -1,7 +1,7 @@ error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file. -!!! error TS5055: Cannot write file 'b.d.ts' because it would overwrite input file. +!!! error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file. ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/library-reference-5.errors.txt b/tests/baselines/reference/library-reference-5.errors.txt index ea571cad1a3c5..a3729bc3a9953 100644 --- a/tests/baselines/reference/library-reference-5.errors.txt +++ b/tests/baselines/reference/library-reference-5.errors.txt @@ -18,7 +18,7 @@ ==== /node_modules/bar/index.d.ts (1 errors) ==== /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! message TS4090: Conflicting library definitions for 'alpha' found at 'index.d.ts' and 'index.d.ts'. Copy the correct file to the 'typings' folder to resolve this conflict. +!!! message TS4090: Conflicting library definitions for 'alpha' found at '/node_modules/bar/node_modules/alpha/index.d.ts' and '/node_modules/foo/node_modules/alpha/index.d.ts'. Copy the correct file to the 'typings' folder to resolve this conflict. declare var bar: any; ==== /node_modules/bar/node_modules/alpha/index.d.ts (0 errors) ==== diff --git a/tests/baselines/reference/parserRealSource1.errors.txt b/tests/baselines/reference/parserRealSource1.errors.txt index 0d238dabf2bef..23d1a1d744a58 100644 --- a/tests/baselines/reference/parserRealSource1.errors.txt +++ b/tests/baselines/reference/parserRealSource1.errors.txt @@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource1.ts(4,1): error TS60 /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript { export module CompilerDiagnostics { diff --git a/tests/baselines/reference/parserRealSource10.errors.txt b/tests/baselines/reference/parserRealSource10.errors.txt index b3c40202c4f54..d6199636e69f2 100644 --- a/tests/baselines/reference/parserRealSource10.errors.txt +++ b/tests/baselines/reference/parserRealSource10.errors.txt @@ -348,7 +348,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,40): error /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript { export enum TokenID { diff --git a/tests/baselines/reference/parserRealSource11.errors.txt b/tests/baselines/reference/parserRealSource11.errors.txt index 718bda19a6737..efae0f962fd1d 100644 --- a/tests/baselines/reference/parserRealSource11.errors.txt +++ b/tests/baselines/reference/parserRealSource11.errors.txt @@ -523,7 +523,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript { export class ASTSpan { diff --git a/tests/baselines/reference/parserRealSource12.errors.txt b/tests/baselines/reference/parserRealSource12.errors.txt index b7b221cbc036e..22fb209d80c26 100644 --- a/tests/baselines/reference/parserRealSource12.errors.txt +++ b/tests/baselines/reference/parserRealSource12.errors.txt @@ -215,7 +215,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource12.ts(524,30): error /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript { export interface IAstWalker { diff --git a/tests/baselines/reference/parserRealSource13.errors.txt b/tests/baselines/reference/parserRealSource13.errors.txt index e9380882e286d..6ddc41ed6109c 100644 --- a/tests/baselines/reference/parserRealSource13.errors.txt +++ b/tests/baselines/reference/parserRealSource13.errors.txt @@ -122,7 +122,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource13.ts(135,36): error /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript.AstWalkerWithDetailCallback { export interface AstWalkerDetailCallback { diff --git a/tests/baselines/reference/parserRealSource14.errors.txt b/tests/baselines/reference/parserRealSource14.errors.txt index bc32a8e585be4..4881864e236aa 100644 --- a/tests/baselines/reference/parserRealSource14.errors.txt +++ b/tests/baselines/reference/parserRealSource14.errors.txt @@ -166,7 +166,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript { export function lastOf(items: any[]): any { diff --git a/tests/baselines/reference/parserRealSource2.errors.txt b/tests/baselines/reference/parserRealSource2.errors.txt index e552cb7781215..42fcff36c7052 100644 --- a/tests/baselines/reference/parserRealSource2.errors.txt +++ b/tests/baselines/reference/parserRealSource2.errors.txt @@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource2.ts(4,1): error TS60 /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript { diff --git a/tests/baselines/reference/parserRealSource3.errors.txt b/tests/baselines/reference/parserRealSource3.errors.txt index 98aae9660a898..5b00994052bdd 100644 --- a/tests/baselines/reference/parserRealSource3.errors.txt +++ b/tests/baselines/reference/parserRealSource3.errors.txt @@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource3.ts(4,1): error TS60 /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript { // Note: Any addition to the NodeType should also be supported with addition to AstWalkerDetailCallback diff --git a/tests/baselines/reference/parserRealSource4.errors.txt b/tests/baselines/reference/parserRealSource4.errors.txt index e0ae0d2221e4c..9722a5b670d4a 100644 --- a/tests/baselines/reference/parserRealSource4.errors.txt +++ b/tests/baselines/reference/parserRealSource4.errors.txt @@ -8,7 +8,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,37): error T /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript { diff --git a/tests/baselines/reference/parserRealSource5.errors.txt b/tests/baselines/reference/parserRealSource5.errors.txt index 78894b2142003..7dc9b5942d525 100644 --- a/tests/baselines/reference/parserRealSource5.errors.txt +++ b/tests/baselines/reference/parserRealSource5.errors.txt @@ -16,7 +16,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource5.ts(61,65): error TS /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript { // TODO: refactor indent logic for use in emit diff --git a/tests/baselines/reference/parserRealSource6.errors.txt b/tests/baselines/reference/parserRealSource6.errors.txt index aa646ca1aba20..aa6a9f4139227 100644 --- a/tests/baselines/reference/parserRealSource6.errors.txt +++ b/tests/baselines/reference/parserRealSource6.errors.txt @@ -67,7 +67,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource6.ts(215,20): error T /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript { export class TypeCollectionContext { diff --git a/tests/baselines/reference/parserRealSource7.errors.txt b/tests/baselines/reference/parserRealSource7.errors.txt index 7945e5d703474..a3635dabc485e 100644 --- a/tests/baselines/reference/parserRealSource7.errors.txt +++ b/tests/baselines/reference/parserRealSource7.errors.txt @@ -309,7 +309,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(828,13): error T /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript { export class Continuation { diff --git a/tests/baselines/reference/parserRealSource8.errors.txt b/tests/baselines/reference/parserRealSource8.errors.txt index d497b0884dbde..6249d3fd991ac 100644 --- a/tests/baselines/reference/parserRealSource8.errors.txt +++ b/tests/baselines/reference/parserRealSource8.errors.txt @@ -140,7 +140,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource8.ts(454,35): error T /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript { diff --git a/tests/baselines/reference/parserRealSource9.errors.txt b/tests/baselines/reference/parserRealSource9.errors.txt index 9d89848ff20ca..caa142db60e9b 100644 --- a/tests/baselines/reference/parserRealSource9.errors.txt +++ b/tests/baselines/reference/parserRealSource9.errors.txt @@ -39,7 +39,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(200,48): error T /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. module TypeScript { export class Binder { diff --git a/tests/baselines/reference/parserharness.errors.txt b/tests/baselines/reference/parserharness.errors.txt index 963ce12ddf18d..fd9ad6d3a107e 100644 --- a/tests/baselines/reference/parserharness.errors.txt +++ b/tests/baselines/reference/parserharness.errors.txt @@ -128,16 +128,16 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'io.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/compiler/io.ts' not found. /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/compiler/typescript.ts' not found. /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'typescriptServices.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/services/typescriptServices.ts' not found. /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'diff.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/RealWorld/diff.ts' not found. declare var assert: Harness.Assert; ~~~~~~ diff --git a/tests/baselines/reference/parserindenter.errors.txt b/tests/baselines/reference/parserindenter.errors.txt index 8ccc92207108d..2f51281e7aab0 100644 --- a/tests/baselines/reference/parserindenter.errors.txt +++ b/tests/baselines/reference/parserindenter.errors.txt @@ -146,7 +146,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(736,38): /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'formatting.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/RealWorld/formatting.ts' not found. module Formatting { diff --git a/tests/baselines/reference/project/nodeModulesImportHigher/amd/importHigher/root.js b/tests/baselines/reference/project/nodeModulesImportHigher/amd/importHigher/root.js new file mode 100644 index 0000000000000..5b8a451c78130 --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesImportHigher/amd/importHigher/root.js @@ -0,0 +1,6 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + "use strict"; + m1.f1("test"); + m1.f2.a = 10; + m1.f2.person.age = "10"; // Error: Should be number (if direct import of m2 made the m3 module visible). +}); diff --git a/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.errors.txt b/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.errors.txt new file mode 100644 index 0000000000000..68a1ef3b7c965 --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.errors.txt @@ -0,0 +1,40 @@ +importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type 'number'. + + +==== entry.js (0 errors) ==== + var m3 = require("m3"); + + module.exports = { + "a": 42, + "b": "hello, world", + "person": m3.person + }; + +==== index.js (0 errors) ==== + var m2 = require('m2'); + + /** + * @param {string} p1 The first param + */ + exports.f1 = function(p1) { + return 42; + }; + + exports.f2 = m2; + +==== index.js (0 errors) ==== + exports.person = { + "name": "John Doe", + "age": 42 + } + +==== importHigher/root.ts (1 errors) ==== + import * as m1 from "m1"; + import * as m2 from "m2"; + + m1.f1("test"); + m1.f2.a = 10; + m1.f2.person.age = "10"; // Error: Should be number (if direct import of m2 made the m3 module visible). + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.json b/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.json new file mode 100644 index 0000000000000..6f422876d3365 --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.json @@ -0,0 +1,18 @@ +{ + "scenario": "Verify that a higher import loads a module that was previously skipped", + "projectRoot": "tests/cases/projects/NodeModulesSearch", + "baselineCheck": true, + "declaration": false, + "moduleResolution": "node", + "project": "importHigher", + "resolvedInputFiles": [ + "lib.d.ts", + "importHigher/node_modules/m2/entry.js", + "importHigher/node_modules/m1/index.js", + "importHigher/node_modules/m2/node_modules/m3/index.js", + "importHigher/root.ts" + ], + "emittedFiles": [ + "importHigher/root.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesImportHigher/node/importHigher/root.js b/tests/baselines/reference/project/nodeModulesImportHigher/node/importHigher/root.js new file mode 100644 index 0000000000000..59944c663e92e --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesImportHigher/node/importHigher/root.js @@ -0,0 +1,5 @@ +"use strict"; +var m1 = require("m1"); +m1.f1("test"); +m1.f2.a = 10; +m1.f2.person.age = "10"; // Error: Should be number (if direct import of m2 made the m3 module visible). diff --git a/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.errors.txt b/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.errors.txt new file mode 100644 index 0000000000000..68a1ef3b7c965 --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.errors.txt @@ -0,0 +1,40 @@ +importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type 'number'. + + +==== entry.js (0 errors) ==== + var m3 = require("m3"); + + module.exports = { + "a": 42, + "b": "hello, world", + "person": m3.person + }; + +==== index.js (0 errors) ==== + var m2 = require('m2'); + + /** + * @param {string} p1 The first param + */ + exports.f1 = function(p1) { + return 42; + }; + + exports.f2 = m2; + +==== index.js (0 errors) ==== + exports.person = { + "name": "John Doe", + "age": 42 + } + +==== importHigher/root.ts (1 errors) ==== + import * as m1 from "m1"; + import * as m2 from "m2"; + + m1.f1("test"); + m1.f2.a = 10; + m1.f2.person.age = "10"; // Error: Should be number (if direct import of m2 made the m3 module visible). + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.json b/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.json new file mode 100644 index 0000000000000..6f422876d3365 --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.json @@ -0,0 +1,18 @@ +{ + "scenario": "Verify that a higher import loads a module that was previously skipped", + "projectRoot": "tests/cases/projects/NodeModulesSearch", + "baselineCheck": true, + "declaration": false, + "moduleResolution": "node", + "project": "importHigher", + "resolvedInputFiles": [ + "lib.d.ts", + "importHigher/node_modules/m2/entry.js", + "importHigher/node_modules/m1/index.js", + "importHigher/node_modules/m2/node_modules/m3/index.js", + "importHigher/root.ts" + ], + "emittedFiles": [ + "importHigher/root.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/maxDepthExceeded/root.js b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/maxDepthExceeded/root.js new file mode 100644 index 0000000000000..73cef6fc02caa --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/maxDepthExceeded/root.js @@ -0,0 +1,6 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + "use strict"; + m1.f1("test"); + m1.f2.a = "10"; // Error: Should be number + m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any". +}); diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt new file mode 100644 index 0000000000000..f03b958275b27 --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt @@ -0,0 +1,32 @@ +maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to type 'number'. + + +==== entry.js (0 errors) ==== + var m3 = require("m3"); + + module.exports = { + "a": 42, + "b": "hello, world", + "person": m3.person + }; + +==== index.js (0 errors) ==== + var m2 = require('m2'); + + /** + * @param {string} p1 The first param + */ + exports.f1 = function(p1) { + return 42; + }; + + exports.f2 = m2; + +==== maxDepthExceeded/root.ts (1 errors) ==== + import * as m1 from "m1"; + m1.f1("test"); + m1.f2.a = "10"; // Error: Should be number + ~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any". + \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.json b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.json new file mode 100644 index 0000000000000..80a0a0fb93dcd --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.json @@ -0,0 +1,17 @@ +{ + "scenario": "Verify that JavaScript modules are not resolved if too many hops", + "projectRoot": "tests/cases/projects/NodeModulesSearch", + "baselineCheck": true, + "declaration": false, + "moduleResolution": "node", + "project": "maxDepthExceeded", + "resolvedInputFiles": [ + "lib.d.ts", + "maxDepthExceeded/node_modules/m2/entry.js", + "maxDepthExceeded/node_modules/m1/index.js", + "maxDepthExceeded/root.ts" + ], + "emittedFiles": [ + "maxDepthExceeded/root.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/maxDepthExceeded/root.js b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/maxDepthExceeded/root.js new file mode 100644 index 0000000000000..28f91fb9b916e --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/maxDepthExceeded/root.js @@ -0,0 +1,5 @@ +"use strict"; +var m1 = require("m1"); +m1.f1("test"); +m1.f2.a = "10"; // Error: Should be number +m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any". diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt new file mode 100644 index 0000000000000..f03b958275b27 --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt @@ -0,0 +1,32 @@ +maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to type 'number'. + + +==== entry.js (0 errors) ==== + var m3 = require("m3"); + + module.exports = { + "a": 42, + "b": "hello, world", + "person": m3.person + }; + +==== index.js (0 errors) ==== + var m2 = require('m2'); + + /** + * @param {string} p1 The first param + */ + exports.f1 = function(p1) { + return 42; + }; + + exports.f2 = m2; + +==== maxDepthExceeded/root.ts (1 errors) ==== + import * as m1 from "m1"; + m1.f1("test"); + m1.f2.a = "10"; // Error: Should be number + ~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any". + \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.json b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.json new file mode 100644 index 0000000000000..80a0a0fb93dcd --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.json @@ -0,0 +1,17 @@ +{ + "scenario": "Verify that JavaScript modules are not resolved if too many hops", + "projectRoot": "tests/cases/projects/NodeModulesSearch", + "baselineCheck": true, + "declaration": false, + "moduleResolution": "node", + "project": "maxDepthExceeded", + "resolvedInputFiles": [ + "lib.d.ts", + "maxDepthExceeded/node_modules/m2/entry.js", + "maxDepthExceeded/node_modules/m1/index.js", + "maxDepthExceeded/root.ts" + ], + "emittedFiles": [ + "maxDepthExceeded/root.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/maxDepthIncreased/root.js b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/maxDepthIncreased/root.js new file mode 100644 index 0000000000000..77951a4889da7 --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/maxDepthIncreased/root.js @@ -0,0 +1,6 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + "use strict"; + m1.f1("test"); + m1.f2.a = 10; + m1.f2.person.age = "10"; // Error: Should be number +}); diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.errors.txt new file mode 100644 index 0000000000000..f63c2a789e8c4 --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.errors.txt @@ -0,0 +1,38 @@ +maxDepthIncreased/root.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'. + + +==== index.js (0 errors) ==== + exports.person = { + "name": "John Doe", + "age": 42 + } + +==== entry.js (0 errors) ==== + var m3 = require("m3"); + + module.exports = { + "a": 42, + "b": "hello, world", + "person": m3.person + }; + +==== index.js (0 errors) ==== + var m2 = require('m2'); + + /** + * @param {string} p1 The first param + */ + exports.f1 = function(p1) { + return 42; + }; + + exports.f2 = m2; + +==== maxDepthIncreased/root.ts (1 errors) ==== + import * as m1 from "m1"; + m1.f1("test"); + m1.f2.a = 10; + m1.f2.person.age = "10"; // Error: Should be number + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.json b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.json new file mode 100644 index 0000000000000..1350bf6441e25 --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.json @@ -0,0 +1,18 @@ +{ + "scenario": "Verify that the setting to search node_modules deeper takes effect", + "projectRoot": "tests/cases/projects/NodeModulesSearch", + "baselineCheck": true, + "declaration": false, + "moduleResolution": "node", + "project": "maxDepthIncreased", + "resolvedInputFiles": [ + "lib.d.ts", + "maxDepthIncreased/node_modules/m2/node_modules/m3/index.js", + "maxDepthIncreased/node_modules/m2/entry.js", + "maxDepthIncreased/node_modules/m1/index.js", + "maxDepthIncreased/root.ts" + ], + "emittedFiles": [ + "maxDepthIncreased/root.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/maxDepthIncreased/root.js b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/maxDepthIncreased/root.js new file mode 100644 index 0000000000000..3a0a96991b058 --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/maxDepthIncreased/root.js @@ -0,0 +1,5 @@ +"use strict"; +var m1 = require("m1"); +m1.f1("test"); +m1.f2.a = 10; +m1.f2.person.age = "10"; // Error: Should be number diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.errors.txt new file mode 100644 index 0000000000000..f63c2a789e8c4 --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.errors.txt @@ -0,0 +1,38 @@ +maxDepthIncreased/root.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'. + + +==== index.js (0 errors) ==== + exports.person = { + "name": "John Doe", + "age": 42 + } + +==== entry.js (0 errors) ==== + var m3 = require("m3"); + + module.exports = { + "a": 42, + "b": "hello, world", + "person": m3.person + }; + +==== index.js (0 errors) ==== + var m2 = require('m2'); + + /** + * @param {string} p1 The first param + */ + exports.f1 = function(p1) { + return 42; + }; + + exports.f2 = m2; + +==== maxDepthIncreased/root.ts (1 errors) ==== + import * as m1 from "m1"; + m1.f1("test"); + m1.f2.a = 10; + m1.f2.person.age = "10"; // Error: Should be number + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.json b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.json new file mode 100644 index 0000000000000..1350bf6441e25 --- /dev/null +++ b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.json @@ -0,0 +1,18 @@ +{ + "scenario": "Verify that the setting to search node_modules deeper takes effect", + "projectRoot": "tests/cases/projects/NodeModulesSearch", + "baselineCheck": true, + "declaration": false, + "moduleResolution": "node", + "project": "maxDepthIncreased", + "resolvedInputFiles": [ + "lib.d.ts", + "maxDepthIncreased/node_modules/m2/node_modules/m3/index.js", + "maxDepthIncreased/node_modules/m2/entry.js", + "maxDepthIncreased/node_modules/m1/index.js", + "maxDepthIncreased/root.ts" + ], + "emittedFiles": [ + "maxDepthIncreased/root.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt index dfbdd67968588..f0809b38f27ae 100644 --- a/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt +++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt @@ -1,7 +1,7 @@ error TS6059: File 'FolderA/FolderB/fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files. -!!! error TS6059: File 'fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files. +!!! error TS6059: File 'FolderA/FolderB/fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files. ==== FolderA/FolderB/FolderC/fileC.ts (0 errors) ==== class C { } diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt index dfbdd67968588..f0809b38f27ae 100644 --- a/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt +++ b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt @@ -1,7 +1,7 @@ error TS6059: File 'FolderA/FolderB/fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files. -!!! error TS6059: File 'fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files. +!!! error TS6059: File 'FolderA/FolderB/fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files. ==== FolderA/FolderB/FolderC/fileC.ts (0 errors) ==== class C { } diff --git a/tests/baselines/reference/requireOfAnEmptyFile1.errors.txt b/tests/baselines/reference/requireOfAnEmptyFile1.errors.txt index d02593feff988..922ff48ef586f 100644 --- a/tests/baselines/reference/requireOfAnEmptyFile1.errors.txt +++ b/tests/baselines/reference/requireOfAnEmptyFile1.errors.txt @@ -6,7 +6,7 @@ tests/cases/compiler/requireOfAnEmptyFile1_a.ts(3,21): error TS2306: File 'tests import fs = require('./requireOfAnEmptyFile1_b'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2306: File 'requireOfAnEmptyFile1_b.ts' is not a module. +!!! error TS2306: File 'tests/cases/compiler/requireOfAnEmptyFile1_b.ts' is not a module. ==== tests/cases/compiler/requireOfAnEmptyFile1_b.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/scannertest1.errors.txt b/tests/baselines/reference/scannertest1.errors.txt index 3831dbe398e33..fce2a0b292a22 100644 --- a/tests/baselines/reference/scannertest1.errors.txt +++ b/tests/baselines/reference/scannertest1.errors.txt @@ -19,7 +19,7 @@ tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(20,23): error TS2304 ==== tests/cases/conformance/scanner/ecmascript5/scannertest1.ts (16 errors) ==== /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'References.ts' not found. +!!! error TS6053: File 'tests/cases/conformance/scanner/ecmascript5/References.ts' not found. class CharacterInfo { public static isDecimalDigit(c: number): boolean { diff --git a/tests/baselines/reference/selfReferencingFile2.errors.txt b/tests/baselines/reference/selfReferencingFile2.errors.txt index c993616784abe..002e087d60ec1 100644 --- a/tests/baselines/reference/selfReferencingFile2.errors.txt +++ b/tests/baselines/reference/selfReferencingFile2.errors.txt @@ -4,7 +4,7 @@ tests/cases/compiler/selfReferencingFile2.ts(1,1): error TS6053: File 'tests/cas ==== tests/cases/compiler/selfReferencingFile2.ts (1 errors) ==== /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'selfReferencingFile2.ts' not found. +!!! error TS6053: File 'tests/cases/selfReferencingFile2.ts' not found. class selfReferencingFile2 { diff --git a/tests/cases/fourslash/importJsNodeModule1.ts b/tests/cases/fourslash/importJsNodeModule1.ts new file mode 100644 index 0000000000000..2c4b6352cb02f --- /dev/null +++ b/tests/cases/fourslash/importJsNodeModule1.ts @@ -0,0 +1,18 @@ +/// + +// @allowJs: true +// @Filename: node_modules/myMod/index.js +//// module.exports = { n: 3, s: 'foo', b: true }; + +// @Filename: consumer.js +//// var x = require('myMod'); +//// x/**/; + +goTo.file('consumer.js'); +goTo.marker(); +edit.insert('.'); +verify.completionListContains("n", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("s", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("b", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +edit.insert('n.'); +verify.completionListContains("toFixed", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); diff --git a/tests/cases/fourslash/importJsNodeModule2.ts b/tests/cases/fourslash/importJsNodeModule2.ts new file mode 100644 index 0000000000000..c8b7c479ddf8c --- /dev/null +++ b/tests/cases/fourslash/importJsNodeModule2.ts @@ -0,0 +1,23 @@ +/// + +// @allowJs: true + +// @Filename: node_modules/myMod/package.json +//// {"main": "entry.js"} + + +// @Filename: node_modules/myMod/entry.js +//// module.exports = { n: 3, s: 'foo', b: true }; + +// @Filename: consumer.js +//// var x = require('myMod'); +//// x/**/; + +goTo.file('consumer.js'); +goTo.marker(); +edit.insert('.'); +verify.completionListContains("n", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("s", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("b", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +edit.insert('n.'); +verify.completionListContains("toFixed", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); diff --git a/tests/cases/fourslash/importJsNodeModule3.ts b/tests/cases/fourslash/importJsNodeModule3.ts new file mode 100644 index 0000000000000..b790d351a1f80 --- /dev/null +++ b/tests/cases/fourslash/importJsNodeModule3.ts @@ -0,0 +1,38 @@ +/// + +// @allowJs: true + +// @Filename: node_modules/myMod/index.js +//// exports.n = 3; +//// exports.s = 'foo'; +//// exports.b = true; + +// @Filename: node_modules/anotherMod/index.js +//// exports.x = 3; +//// exports.y = 'foo'; +//// /** +//// * @param {(number | boolean)} a The first param +//// * @param {Array} b The second param +//// */ +//// exports.z = function(a,b){ return "test"; }; + +// @Filename: consumer.js +//// import * as x from 'myMod'; +//// import {y,z} from 'anotherMod'; +//// x/**/; + +goTo.file('consumer.js'); +goTo.marker(); +edit.insert('.'); +verify.completionListContains("n", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("s", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("b", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +edit.insert('n.'); +verify.completionListContains("toFixed", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); + +edit.backspace(4); +edit.insert('y.'); +verify.completionListContains("toUpperCase", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); +edit.backspace(2); +edit.insert('z('); +verify.currentSignatureHelpIs("z(a: number | boolean, b: string[]): string"); diff --git a/tests/cases/fourslash/importJsNodeModule4.ts b/tests/cases/fourslash/importJsNodeModule4.ts new file mode 100644 index 0000000000000..917bea35842d6 --- /dev/null +++ b/tests/cases/fourslash/importJsNodeModule4.ts @@ -0,0 +1,19 @@ +/// + +// @allowJs: true + +// @Filename: node_modules/myMod/index.js +//// module.exports = { n: 3, s: 'foo', b: true }; + +// @Filename: consumer.js +//// import * as x from 'myMod'; +//// x/**/; + +goTo.file('consumer.js'); +goTo.marker(); +edit.insert('.'); +verify.completionListContains("n", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("s", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("b", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +edit.insert('n.'); +verify.completionListContains("toFixed", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); diff --git a/tests/cases/project/nodeModulesImportHigher.json b/tests/cases/project/nodeModulesImportHigher.json new file mode 100644 index 0000000000000..2cca8c03f001f --- /dev/null +++ b/tests/cases/project/nodeModulesImportHigher.json @@ -0,0 +1,8 @@ +{ + "scenario": "Verify that a higher import loads a module that was previously skipped", + "projectRoot": "tests/cases/projects/NodeModulesSearch", + "baselineCheck": true, + "declaration": false, + "moduleResolution": "node", + "project": "importHigher" +} diff --git a/tests/cases/project/nodeModulesMaxDepthExceeded.json b/tests/cases/project/nodeModulesMaxDepthExceeded.json new file mode 100644 index 0000000000000..45e1210aa8cb7 --- /dev/null +++ b/tests/cases/project/nodeModulesMaxDepthExceeded.json @@ -0,0 +1,8 @@ +{ + "scenario": "Verify that JavaScript modules are not resolved if too many hops", + "projectRoot": "tests/cases/projects/NodeModulesSearch", + "baselineCheck": true, + "declaration": false, + "moduleResolution": "node", + "project": "maxDepthExceeded" +} diff --git a/tests/cases/project/nodeModulesMaxDepthIncreased.json b/tests/cases/project/nodeModulesMaxDepthIncreased.json new file mode 100644 index 0000000000000..0973ae4bd5b15 --- /dev/null +++ b/tests/cases/project/nodeModulesMaxDepthIncreased.json @@ -0,0 +1,8 @@ +{ + "scenario": "Verify that the setting to search node_modules deeper takes effect", + "projectRoot": "tests/cases/projects/NodeModulesSearch", + "baselineCheck": true, + "declaration": false, + "moduleResolution": "node", + "project": "maxDepthIncreased" +} diff --git a/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m1/index.js b/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m1/index.js new file mode 100644 index 0000000000000..7ff454a240273 --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m1/index.js @@ -0,0 +1,10 @@ +var m2 = require('m2'); + +/** + * @param {string} p1 The first param + */ +exports.f1 = function(p1) { + return 42; +}; + +exports.f2 = m2; diff --git a/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m2/entry.js b/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m2/entry.js new file mode 100644 index 0000000000000..ce3eee6d895f0 --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m2/entry.js @@ -0,0 +1,7 @@ +var m3 = require("m3"); + +module.exports = { + "a": 42, + "b": "hello, world", + "person": m3.person +}; diff --git a/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m2/node_modules/m3/index.js b/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m2/node_modules/m3/index.js new file mode 100644 index 0000000000000..aeec67076973b --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m2/node_modules/m3/index.js @@ -0,0 +1,4 @@ +exports.person = { + "name": "John Doe", + "age": 42 +} diff --git a/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m2/package.json b/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m2/package.json new file mode 100644 index 0000000000000..33534249d414c --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/importHigher/node_modules/m2/package.json @@ -0,0 +1,3 @@ +{ + "main": "entry.js" +} diff --git a/tests/cases/projects/NodeModulesSearch/importHigher/root.ts b/tests/cases/projects/NodeModulesSearch/importHigher/root.ts new file mode 100644 index 0000000000000..9bf5b1f82c314 --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/importHigher/root.ts @@ -0,0 +1,6 @@ +import * as m1 from "m1"; +import * as m2 from "m2"; + +m1.f1("test"); +m1.f2.a = 10; +m1.f2.person.age = "10"; // Error: Should be number (if direct import of m2 made the m3 module visible). diff --git a/tests/cases/projects/NodeModulesSearch/importHigher/tsconfig.json b/tests/cases/projects/NodeModulesSearch/importHigher/tsconfig.json new file mode 100644 index 0000000000000..c7b95984b42b7 --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/importHigher/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "allowJs": true, + "declaration": false, + "moduleResolution": "node" + } +} diff --git a/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m1/index.js b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m1/index.js new file mode 100644 index 0000000000000..7ff454a240273 --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m1/index.js @@ -0,0 +1,10 @@ +var m2 = require('m2'); + +/** + * @param {string} p1 The first param + */ +exports.f1 = function(p1) { + return 42; +}; + +exports.f2 = m2; diff --git a/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m2/entry.js b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m2/entry.js new file mode 100644 index 0000000000000..ce3eee6d895f0 --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m2/entry.js @@ -0,0 +1,7 @@ +var m3 = require("m3"); + +module.exports = { + "a": 42, + "b": "hello, world", + "person": m3.person +}; diff --git a/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m2/node_modules/m3/index.js b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m2/node_modules/m3/index.js new file mode 100644 index 0000000000000..aeec67076973b --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m2/node_modules/m3/index.js @@ -0,0 +1,4 @@ +exports.person = { + "name": "John Doe", + "age": 42 +} diff --git a/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m2/package.json b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m2/package.json new file mode 100644 index 0000000000000..33534249d414c --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/node_modules/m2/package.json @@ -0,0 +1,3 @@ +{ + "main": "entry.js" +} diff --git a/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/root.ts b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/root.ts new file mode 100644 index 0000000000000..6260440864805 --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/root.ts @@ -0,0 +1,4 @@ +import * as m1 from "m1"; +m1.f1("test"); +m1.f2.a = "10"; // Error: Should be number +m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any". diff --git a/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/tsconfig.json b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/tsconfig.json new file mode 100644 index 0000000000000..0aafe67d68893 --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "allowJs": true + } +} diff --git a/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m1/index.js b/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m1/index.js new file mode 100644 index 0000000000000..7ff454a240273 --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m1/index.js @@ -0,0 +1,10 @@ +var m2 = require('m2'); + +/** + * @param {string} p1 The first param + */ +exports.f1 = function(p1) { + return 42; +}; + +exports.f2 = m2; diff --git a/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m2/entry.js b/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m2/entry.js new file mode 100644 index 0000000000000..ce3eee6d895f0 --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m2/entry.js @@ -0,0 +1,7 @@ +var m3 = require("m3"); + +module.exports = { + "a": 42, + "b": "hello, world", + "person": m3.person +}; diff --git a/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m2/node_modules/m3/index.js b/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m2/node_modules/m3/index.js new file mode 100644 index 0000000000000..aeec67076973b --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m2/node_modules/m3/index.js @@ -0,0 +1,4 @@ +exports.person = { + "name": "John Doe", + "age": 42 +} diff --git a/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m2/package.json b/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m2/package.json new file mode 100644 index 0000000000000..33534249d414c --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/node_modules/m2/package.json @@ -0,0 +1,3 @@ +{ + "main": "entry.js" +} diff --git a/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/root.ts b/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/root.ts new file mode 100644 index 0000000000000..9ed943bebba36 --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/root.ts @@ -0,0 +1,4 @@ +import * as m1 from "m1"; +m1.f1("test"); +m1.f2.a = 10; +m1.f2.person.age = "10"; // Error: Should be number diff --git a/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/tsconfig.json b/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/tsconfig.json new file mode 100644 index 0000000000000..5388cc5d39fdd --- /dev/null +++ b/tests/cases/projects/NodeModulesSearch/maxDepthIncreased/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "allowJs": true, + "maxNodeModuleJsDepth": 3 + } +}