Skip to content

Commit d8468f7

Browse files
committed
Merge pull request #1594 from Microsoft/allowNonTsExtensionsVsNoExtensions
fixes #1593
2 parents 1ebf905 + b399ce8 commit d8468f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiler/parser.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5231,7 +5231,10 @@ module ts {
52315231
}
52325232
}
52335233
else {
5234-
if (!(findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) || findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd))) {
5234+
if(options.allowNonTsExtensions && !findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) {
5235+
diagnostic = Diagnostics.File_0_not_found;
5236+
}
5237+
else if (!findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) && !findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd)) {
52355238
diagnostic = Diagnostics.File_0_not_found;
52365239
filename += ".ts";
52375240
}

0 commit comments

Comments
 (0)