@@ -4149,7 +4149,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
41494149 if (!isIdentifier(name)) {
41504150 return undefined;
41514151 }
4152- const suppressInteropError = name.escapedText === InternalSymbolName.Default && !!(compilerOptions.allowSyntheticDefaultImports || getESModuleInterop (compilerOptions));
4152+ const suppressInteropError = name.escapedText === InternalSymbolName.Default && !!(getAllowSyntheticDefaultImports (compilerOptions));
41534153 const targetSymbol = resolveESModuleSymbol(moduleSymbol, moduleSpecifier, /*dontResolveAlias*/ false, suppressInteropError);
41544154 if (targetSymbol) {
41554155 if (name.escapedText) {
@@ -9204,7 +9204,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
92049204 // If `target` refers to a shorthand module symbol, the name we're trying to pull out isn;t recoverable from the target symbol
92059205 // In such a scenario, we must fall back to looking for an alias declaration on `symbol` and pulling the target name from that
92069206 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)) {
92089208 // target refers to an `export=` symbol that was hoisted into a synthetic default - rename here to match
92099209 verbatimTargetName = InternalSymbolName.Default;
92109210 }
@@ -34163,7 +34163,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3416334163 }
3416434164
3416534165 // 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
3416734168 return resolveExternalModuleTypeByLiteral(node.arguments![0] as StringLiteral);
3416834169 }
3416934170
0 commit comments