Merge pull request #27260 from valera-rozuvan/fix-27086

Fix 27086. Ignore directories starting with a dot.
This commit is contained in:
Sheetal Nandi 2018-09-26 11:11:37 -07:00 committed by GitHub
commit 1a63c67e8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 73 additions and 2 deletions

View file

@ -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);
}
}
}
}

View file

@ -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;

View file

@ -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))

View file

@ -0,0 +1,8 @@
=== /a.ts ===
a;
>a : string
=== /node_modules/@types/a/index.d.ts ===
declare const a: string;
>a : string

View file

@ -0,0 +1,11 @@
//// [tests/cases/compiler/moduleResolution_noLeadingDot.ts] ////
//// [README.md]
This is a test.
//// [a.ts]
true;
//// [a.js]
true;

View file

@ -0,0 +1,4 @@
=== /a.ts ===
true;
No type information for this code.
No type information for this code.

View file

@ -0,0 +1,4 @@
=== /a.ts ===
true;
>true : true

View file

@ -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;

View file

@ -0,0 +1,7 @@
// @noImplicitReferences: true
// @Filename: /node_modules/@types/.svn/README.md
This is a test.
// @Filename: /a.ts
true;