forked from microsoft/TypeScript
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request microsoft#10510 from Microsoft/import_directory
An import ending in "/" is always an import of a directory.
- Loading branch information
Showing
14 changed files
with
114 additions
and
40 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
28 changes: 28 additions & 0 deletions
28
tests/baselines/reference/importWithTrailingSlash.trace.json
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[ | ||
"======== Resolving module '.' from '/a/test.ts'. ========", | ||
"Explicitly specified module resolution kind: 'NodeJs'.", | ||
"Loading module as file / folder, candidate module location '/a'.", | ||
"File '/a.ts' exist - use it as a name resolution result.", | ||
"Resolving real path for '/a.ts', result '/a.ts'", | ||
"======== Module name '.' was successfully resolved to '/a.ts'. ========", | ||
"======== Resolving module './' from '/a/test.ts'. ========", | ||
"Explicitly specified module resolution kind: 'NodeJs'.", | ||
"Loading module as file / folder, candidate module location '/a/'.", | ||
"File '/a/package.json' does not exist.", | ||
"File '/a/index.ts' exist - use it as a name resolution result.", | ||
"Resolving real path for '/a/index.ts', result '/a/index.ts'", | ||
"======== Module name './' was successfully resolved to '/a/index.ts'. ========", | ||
"======== Resolving module '..' from '/a/b/test.ts'. ========", | ||
"Explicitly specified module resolution kind: 'NodeJs'.", | ||
"Loading module as file / folder, candidate module location '/a'.", | ||
"File '/a.ts' exist - use it as a name resolution result.", | ||
"Resolving real path for '/a.ts', result '/a.ts'", | ||
"======== Module name '..' was successfully resolved to '/a.ts'. ========", | ||
"======== Resolving module '../' from '/a/b/test.ts'. ========", | ||
"Explicitly specified module resolution kind: 'NodeJs'.", | ||
"Loading module as file / folder, candidate module location '/a/'.", | ||
"File '/a/package.json' does not exist.", | ||
"File '/a/index.ts' exist - use it as a name resolution result.", | ||
"Resolving real path for '/a/index.ts', result '/a/index.ts'", | ||
"======== Module name '../' was successfully resolved to '/a/index.ts'. ========" | ||
] |
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
9 changes: 9 additions & 0 deletions
9
tests/baselines/reference/importWithTrailingSlash_noResolve.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/a.ts(2,17): error TS2307: Cannot find module './foo/'. | ||
|
||
|
||
==== /a.ts (1 errors) ==== | ||
|
||
import foo from "./foo/"; | ||
~~~~~~~~ | ||
!!! error TS2307: Cannot find module './foo/'. | ||
|
7 changes: 7 additions & 0 deletions
7
tests/baselines/reference/importWithTrailingSlash_noResolve.js
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//// [a.ts] | ||
|
||
import foo from "./foo/"; | ||
|
||
|
||
//// [a.js] | ||
"use strict"; |
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/importWithTrailingSlash_noResolve.trace.json
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
"======== Resolving module './foo/' from '/a.ts'. ========", | ||
"Explicitly specified module resolution kind: 'NodeJs'.", | ||
"Loading module as file / folder, candidate module location '/foo/'.", | ||
"File '/foo/package.json' does not exist.", | ||
"File '/foo/index.ts' does not exist.", | ||
"File '/foo/index.tsx' does not exist.", | ||
"File '/foo/index.d.ts' does not exist.", | ||
"======== Module name './foo/' was not resolved. ========" | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// @traceResolution: true | ||
// @moduleResolution: node | ||
|
||
// @Filename: /a.ts | ||
import foo from "./foo/"; |