mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Do not report esModuleInterop needed error for json imports
Fixes #25400
This commit is contained in:
1 parent
50ef631b59
commit
cb622b413b
5 files changed
+64
-1
No files matched your search
@@ -2268,7 +2268,7 @@ namespace ts {
|
||||
function resolveESModuleSymbol(moduleSymbol: Symbol | undefined, referencingLocation: Node, dontResolveAlias: boolean): Symbol | undefined {
|
||||
const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
|
||||
if (!dontResolveAlias && symbol) {
|
||||
if (!(symbol.flags & (SymbolFlags.Module | SymbolFlags.Variable))) {
|
||||
if (!(symbol.flags & (SymbolFlags.Module | SymbolFlags.Variable)) && !getDeclarationOfKind(symbol, SyntaxKind.SourceFile)) {
|
||||
error(referencingLocation, Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol!));
|
||||
return symbol;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user