diff --git a/src/compiler/program.ts b/src/compiler/program.ts index dbcf94cc8f0..f6ca228d30d 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -237,12 +237,7 @@ namespace ts { } function getEffectiveTypesPrimarySearchPaths(options: CompilerOptions): string[] { - if (options.typesSearchPaths) { - return options.typesSearchPaths; - } - return options.configFilePath - ? [getDirectoryPath(options.configFilePath)].concat(defaultLibrarySearchPaths) - : defaultLibrarySearchPaths; + return options.typesSearchPaths || defaultLibrarySearchPaths; } export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string, compilationRoot: string, options: CompilerOptions, host: ModuleResolutionHost): ResolvedTypeReferenceDirectiveWithFailedLookupLocations { @@ -1767,9 +1762,9 @@ namespace ts { const resolvedTypeReferenceDirective = resolutions[i]; // store resolved type directive on the file setResolvedTypeReferenceDirective(file, ref.fileName, resolvedTypeReferenceDirective); - // If we already found this library as a primary reference, or failed to find it, nothing to do + // If we already found this library as a primary reference - nothing to do const previousResolution = resolvedTypeReferenceDirectives[ref.fileName]; - if (previousResolution && (previousResolution.primary || (previousResolution.resolvedFileName === undefined))) { + if (previousResolution && previousResolution.primary) { continue; } let saveResolution = true; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 0122ac54c81..144a21b8c0d 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2750,13 +2750,6 @@ namespace ts { isExternalLibraryImport?: boolean; } - export interface ResolvedLibrary { - // True if the library was found in a primary lookup location - primary: boolean; - // The location of the .d.ts file we located, or undefined if resolution failed - resolvedFileName?: string; - } - export interface ResolvedModuleWithFailedLookupLocations { resolvedModule: ResolvedModule; failedLookupLocations: string[]; diff --git a/tests/baselines/reference/library-reference-6.trace.json b/tests/baselines/reference/library-reference-6.trace.json index 2fec0fa7547..0442a008dfb 100644 --- a/tests/baselines/reference/library-reference-6.trace.json +++ b/tests/baselines/reference/library-reference-6.trace.json @@ -1,8 +1,5 @@ [ "======== Resolving type reference directive 'alpha' from '/src/foo.ts' with compilation root dir '/'. ========", - "Resolving with primary search path '/'", - "File '/alpha/package.json' does not exist.", - "File '/alpha/index.d.ts' does not exist.", "Resolving with primary search path '/types/'", "File '/types/alpha/package.json' does not exist.", "File '/types/alpha/index.d.ts' exist - use it as a name resolution result.", diff --git a/tests/baselines/reference/library-reference-7.trace.json b/tests/baselines/reference/library-reference-7.trace.json index 094e3640da7..d495e27cdc5 100644 --- a/tests/baselines/reference/library-reference-7.trace.json +++ b/tests/baselines/reference/library-reference-7.trace.json @@ -1,8 +1,5 @@ [ "======== Resolving type reference directive 'alpha' from '/base/src/foo.ts' with compilation root dir '/base'. ========", - "Resolving with primary search path '/'", - "File '/alpha/package.json' does not exist.", - "File '/alpha/index.d.ts' does not exist.", "Resolving with primary search path '/base/types/'", "File '/base/types/alpha/package.json' does not exist.", "File '/base/types/alpha/index.d.ts' exist - use it as a name resolution result.",