@@ -4149,7 +4149,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4149
4149
if (!isIdentifier(name)) {
4150
4150
return undefined;
4151
4151
}
4152
- const suppressInteropError = name.escapedText === InternalSymbolName.Default && !!(compilerOptions.allowSyntheticDefaultImports || getESModuleInterop (compilerOptions));
4152
+ const suppressInteropError = name.escapedText === InternalSymbolName.Default && !!(getAllowSyntheticDefaultImports (compilerOptions));
4153
4153
const targetSymbol = resolveESModuleSymbol(moduleSymbol, moduleSpecifier, /*dontResolveAlias*/ false, suppressInteropError);
4154
4154
if (targetSymbol) {
4155
4155
if (name.escapedText) {
@@ -9204,7 +9204,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
9204
9204
// If `target` refers to a shorthand module symbol, the name we're trying to pull out isn;t recoverable from the target symbol
9205
9205
// In such a scenario, we must fall back to looking for an alias declaration on `symbol` and pulling the target name from that
9206
9206
let verbatimTargetName = isShorthandAmbientModuleSymbol(target) && getSomeTargetNameFromDeclarations(symbol.declarations) || unescapeLeadingUnderscores(target.escapedName);
9207
- if (verbatimTargetName === InternalSymbolName.ExportEquals && (getESModuleInterop( compilerOptions) || compilerOptions.allowSyntheticDefaultImports )) {
9207
+ if (verbatimTargetName === InternalSymbolName.ExportEquals && getAllowSyntheticDefaultImports( compilerOptions)) {
9208
9208
// target refers to an `export=` symbol that was hoisted into a synthetic default - rename here to match
9209
9209
verbatimTargetName = InternalSymbolName.Default;
9210
9210
}
@@ -34163,7 +34163,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
34163
34163
}
34164
34164
34165
34165
// In JavaScript files, calls to any identifier 'require' are treated as external module imports
34166
- if (isInJSFile(node) && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Bundler && isCommonJsRequire(node)) {
34166
+ if (isInJSFile(node) && (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Bundler || compilerOptions.noDtsResolution) && isCommonJsRequire(node)) {
34167
+ // `bundler` doesn't support resolving `require`, but needs to in `noDtsResolution` to support Find Source Definition
34167
34168
return resolveExternalModuleTypeByLiteral(node.arguments![0] as StringLiteral);
34168
34169
}
34169
34170
0 commit comments