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
  • Loading branch information
clydin authored and filipesilva committed Jul 9, 2021
1 parent 7536338 commit 720feee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ngtools/webpack/src/ivy/plugin.ts
Expand Up @@ -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));
}
}
Expand Down

0 comments on commit 720feee

Please sign in to comment.