Skip to content

Commit 30638d4

Browse files
clydinfilipesilva
authored andcommitted
fix(@ngtools/webpack): avoid non-actionable template type-checker syntax diagnostics
The AOT compiler's internal template type-checking files are not intended to be directly analyzed for diagnostics by the emitting program and are instead analyzed during the template type-checking phase. Previously, only semantic diagnostics were ignored. Now both syntactic and semantic diagnostics are ignored. This change prevents non-actionable diagnostics from being shown during a build. Addresses: angular/angular#42667 (cherry picked from commit 720feee)
1 parent e1074eb commit 30638d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/ngtools/webpack/src/ivy/plugin.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -491,18 +491,18 @@ export class AngularWebpackPlugin {
491491
}
492492
}
493493

494-
// Collect non-semantic diagnostics
494+
// Collect program level diagnostics
495495
const diagnostics = [
496496
...angularCompiler.getOptionDiagnostics(),
497497
...builder.getOptionsDiagnostics(),
498498
...builder.getGlobalDiagnostics(),
499-
...builder.getSyntacticDiagnostics(),
500499
];
501500
diagnosticsReporter(diagnostics);
502501

503-
// Collect semantic diagnostics
502+
// Collect source file specific diagnostics
504503
for (const sourceFile of builder.getSourceFiles()) {
505504
if (!ignoreForDiagnostics.has(sourceFile)) {
505+
diagnosticsReporter(builder.getSyntacticDiagnostics(sourceFile));
506506
diagnosticsReporter(builder.getSemanticDiagnostics(sourceFile));
507507
}
508508
}

0 commit comments

Comments
 (0)