Skip to content

Commit

Permalink
fix(@ngtools/webpack): avoid non-actionable template type-checker syn…
Browse files Browse the repository at this point in the history
…tax 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)
  • Loading branch information
clydin authored and filipesilva committed Jul 9, 2021
1 parent e1074eb commit 30638d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ngtools/webpack/src/ivy/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,18 +491,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));
}
}
Expand Down

0 comments on commit 30638d4

Please sign in to comment.