From 720feee34f910fc11c40e2f68d919d61b7d6cbec Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Thu, 8 Jul 2021 14:42:44 -0400 Subject: [PATCH] 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: https://github.com/angular/angular/issues/42667 --- packages/ngtools/webpack/src/ivy/plugin.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ngtools/webpack/src/ivy/plugin.ts b/packages/ngtools/webpack/src/ivy/plugin.ts index b8c17b2c5ad0..b1013d1b2f85 100644 --- a/packages/ngtools/webpack/src/ivy/plugin.ts +++ b/packages/ngtools/webpack/src/ivy/plugin.ts @@ -495,18 +495,18 @@ export class AngularWebpackPlugin { } } - // Collect non-semantic diagnostics + // Collect program level diagnostics const diagnostics = [ ...angularCompiler.getOptionDiagnostics(), ...builder.getOptionsDiagnostics(), ...builder.getGlobalDiagnostics(), - ...builder.getSyntacticDiagnostics(), ]; diagnosticsReporter(diagnostics); - // Collect semantic diagnostics + // Collect source file specific diagnostics for (const sourceFile of builder.getSourceFiles()) { if (!ignoreForDiagnostics.has(sourceFile)) { + diagnosticsReporter(builder.getSyntacticDiagnostics(sourceFile)); diagnosticsReporter(builder.getSemanticDiagnostics(sourceFile)); } }