Skip to content

Commit 720feee

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
1 parent 7536338 commit 720feee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: packages/ngtools/webpack/src/ivy/plugin.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -495,18 +495,18 @@ export class AngularWebpackPlugin {
495495
}
496496
}
497497

498-
// Collect non-semantic diagnostics
498+
// Collect program level diagnostics
499499
const diagnostics = [
500500
...angularCompiler.getOptionDiagnostics(),
501501
...builder.getOptionsDiagnostics(),
502502
...builder.getGlobalDiagnostics(),
503-
...builder.getSyntacticDiagnostics(),
504503
];
505504
diagnosticsReporter(diagnostics);
506505

507-
// Collect semantic diagnostics
506+
// Collect source file specific diagnostics
508507
for (const sourceFile of builder.getSourceFiles()) {
509508
if (!ignoreForDiagnostics.has(sourceFile)) {
509+
diagnosticsReporter(builder.getSyntacticDiagnostics(sourceFile));
510510
diagnosticsReporter(builder.getSemanticDiagnostics(sourceFile));
511511
}
512512
}

0 commit comments

Comments
 (0)