mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 16:29:19 -05:00
addressed PR feedback
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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[];
|
||||
|
||||
@@ -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.",
|
||||
|
||||
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user