Skip ID inference errors on nodes collected from other files (#59203)

This commit is contained in:
Wesley Wigham
2024-07-09 16:03:17 -07:00
committed by GitHub
parent 9afdd74b40
commit de77dd4726
6 changed files with 529 additions and 0 deletions

View File

@@ -308,6 +308,7 @@ export function transformDeclarations(context: TransformationContext) {
}
function reportInferenceFallback(node: Node) {
if (!isolatedDeclarations || isSourceFileJS(currentSourceFile)) return;
if (getSourceFileOfNode(node) !== currentSourceFile) return; // Nested error on a declaration in another file - ignore, will be reemitted if file is in the output file set
if (isVariableDeclaration(node) && resolver.isExpandoFunctionDeclaration(node)) {
reportExpandoFunctionErrors(node);
}