Merge pull request #27260 from valera-rozuvan/fix-27086
Fix 27086. Ignore directories starting with a dot.
This commit is contained in:
commit
1a63c67e8a
|
@ -381,8 +381,13 @@ namespace ts {
|
|||
// tslint:disable-next-line:no-null-keyword
|
||||
const isNotNeededPackage = host.fileExists(packageJsonPath) && (readJson(packageJsonPath, host) as PackageJson).typings === null;
|
||||
if (!isNotNeededPackage) {
|
||||
// Return just the type directive names
|
||||
result.push(getBaseFileName(normalized));
|
||||
const baseFileName = getBaseFileName(normalized);
|
||||
|
||||
// At this stage, skip results with leading dot.
|
||||
if (baseFileName.charCodeAt(0) !== CharacterCodes.dot) {
|
||||
// Return just the type directive names
|
||||
result.push(baseFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
//// [tests/cases/compiler/moduleResolution_automaticTypeDirectiveNames.ts] ////
|
||||
|
||||
//// [index.d.ts]
|
||||
declare const a: number;
|
||||
|
||||
//// [index.d.ts]
|
||||
declare const a: string;
|
||||
|
||||
//// [a.ts]
|
||||
a;
|
||||
|
||||
|
||||
//// [a.js]
|
||||
a;
|
|
@ -0,0 +1,8 @@
|
|||
=== /a.ts ===
|
||||
a;
|
||||
>a : Symbol(a, Decl(index.d.ts, 0, 13))
|
||||
|
||||
=== /node_modules/@types/a/index.d.ts ===
|
||||
declare const a: string;
|
||||
>a : Symbol(a, Decl(index.d.ts, 0, 13))
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
=== /a.ts ===
|
||||
a;
|
||||
>a : string
|
||||
|
||||
=== /node_modules/@types/a/index.d.ts ===
|
||||
declare const a: string;
|
||||
>a : string
|
||||
|
11
tests/baselines/reference/moduleResolution_noLeadingDot.js
Normal file
11
tests/baselines/reference/moduleResolution_noLeadingDot.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
//// [tests/cases/compiler/moduleResolution_noLeadingDot.ts] ////
|
||||
|
||||
//// [README.md]
|
||||
This is a test.
|
||||
|
||||
//// [a.ts]
|
||||
true;
|
||||
|
||||
|
||||
//// [a.js]
|
||||
true;
|
|
@ -0,0 +1,4 @@
|
|||
=== /a.ts ===
|
||||
true;
|
||||
No type information for this code.
|
||||
No type information for this code.
|
|
@ -0,0 +1,4 @@
|
|||
=== /a.ts ===
|
||||
true;
|
||||
>true : true
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
// @noImplicitReferences: true
|
||||
|
||||
// @Filename: /node_modules/@types/.a/index.d.ts
|
||||
declare const a: number;
|
||||
|
||||
// @Filename: /node_modules/@types/a/index.d.ts
|
||||
declare const a: string;
|
||||
|
||||
// @Filename: /a.ts
|
||||
a;
|
7
tests/cases/compiler/moduleResolution_noLeadingDot.ts
Normal file
7
tests/cases/compiler/moduleResolution_noLeadingDot.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
// @noImplicitReferences: true
|
||||
|
||||
// @Filename: /node_modules/@types/.svn/README.md
|
||||
This is a test.
|
||||
|
||||
// @Filename: /a.ts
|
||||
true;
|
Loading…
Reference in a new issue