-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't allow ".d.ts" extension in an import either.
- Loading branch information
Andy Hanson
committed
Aug 3, 2016
1 parent
0f134ed
commit 359c8b1
Showing
9 changed files
with
46 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 19 additions & 13 deletions
32
tests/baselines/reference/moduleResolutionNoTs.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
tests/cases/compiler/user.ts(4,15): error TS2691: An import path should not end with a '.ts' extension. Consider importing './x' instead. | ||
tests/cases/compiler/user.ts(5,15): error TS2691: An import path should not end with a '.tsx' extension. Consider importing './y' instead. | ||
tests/cases/compiler/user.ts(1,15): error TS2691: An import path cannot end with a '.ts' extension. Consider importing './x' instead. | ||
tests/cases/compiler/user.ts(2,15): error TS2691: An import path cannot end with a '.tsx' extension. Consider importing './y' instead. | ||
tests/cases/compiler/user.ts(3,15): error TS2691: An import path cannot end with a '.d.ts' extension. Consider importing './z' instead. | ||
|
||
|
||
==== tests/cases/compiler/user.ts (2 errors) ==== | ||
// '.ts' extension is OK in a reference | ||
///<reference path="./x.ts"/> | ||
==== tests/cases/compiler/x.ts (0 errors) ==== | ||
export default 0; | ||
|
||
==== tests/cases/compiler/y.tsx (0 errors) ==== | ||
export default 0; | ||
|
||
==== tests/cases/compiler/z.d.ts (0 errors) ==== | ||
declare const x: number; | ||
export default x; | ||
|
||
==== tests/cases/compiler/user.ts (3 errors) ==== | ||
import x from "./x.ts"; | ||
~~~~~~~~ | ||
!!! error TS2691: An import path should not end with a '.ts' extension. Consider importing './x' instead. | ||
!!! error TS2691: An import path cannot end with a '.ts' extension. Consider importing './x' instead. | ||
import y from "./y.tsx"; | ||
~~~~~~~~~ | ||
!!! error TS2691: An import path should not end with a '.tsx' extension. Consider importing './y' instead. | ||
!!! error TS2691: An import path cannot end with a '.tsx' extension. Consider importing './y' instead. | ||
import z from "./z.d.ts"; | ||
~~~~~~~~~~ | ||
!!! error TS2691: An import path cannot end with a '.d.ts' extension. Consider importing './z' instead. | ||
|
||
// Making sure the suggested fixes are valid: | ||
import x2 from "./x"; | ||
import y2 from "./y"; | ||
|
||
==== tests/cases/compiler/x.ts (0 errors) ==== | ||
export default 0; | ||
|
||
==== tests/cases/compiler/y.tsx (0 errors) ==== | ||
export default 0; | ||
import z2 from "./z"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters