Skip to content

Commit a68b4cc

Browse files
committed
Revert "fixed missing module resolution errors"
This reverts commit 908ddd0.
1 parent 1c41b56 commit a68b4cc

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46812,7 +46812,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4681246812
}
4681346813
if (checkExternalImportOrExportDeclaration(node)) {
4681446814
const importClause = node.importClause;
46815-
const moduleExisted = resolveExternalModuleName(node, node.moduleSpecifier);
4681646815
if (importClause && !checkGrammarImportClause(importClause)) {
4681746816
if (importClause.name) {
4681846817
checkImportBinding(importClause);
@@ -46825,8 +46824,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4682546824
checkExternalEmitHelpers(node, ExternalEmitHelpers.ImportStar);
4682646825
}
4682746826
}
46828-
else if (moduleExisted) {
46829-
forEach(importClause.namedBindings.elements, checkImportBinding);
46827+
else {
46828+
const moduleExisted = resolveExternalModuleName(node, node.moduleSpecifier);
46829+
if (moduleExisted) {
46830+
forEach(importClause.namedBindings.elements, checkImportBinding);
46831+
}
4683046832
}
4683146833
}
4683246834
}

tests/baselines/reference/tscWatch/programUpdates/when-changing-`allowImportingTsExtensions`-of-config-file.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
currentDirectory:: /user/username/projects/myproject useCaseSensitiveFileNames: false
22
Input::
33
//// [/user/username/projects/myproject/a.ts]
4-
export {};
4+
55

66
//// [/user/username/projects/myproject/b.ts]
77
import "./a.ts";
@@ -47,12 +47,7 @@ DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_mod
4747
Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Type roots
4848
DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Type roots
4949
Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Type roots
50-
b.ts:1:8 - error TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
51-
52-
1 import "./a.ts";
53-
   ~~~~~~~~
54-
55-
[HH:MM:SS AM] Found 1 error. Watching for file changes.
50+
[HH:MM:SS AM] Found 0 errors. Watching for file changes.
5651

5752
DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 undefined Wild card directory
5853
Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 undefined Wild card directory

0 commit comments

Comments
 (0)