mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-22 23:15:56 +08:00
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
This commit is contained in:
parent
7536338e0b
commit
720feee34f
@ -495,18 +495,18 @@ export class AngularWebpackPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collect non-semantic diagnostics
|
// Collect program level diagnostics
|
||||||
const diagnostics = [
|
const diagnostics = [
|
||||||
...angularCompiler.getOptionDiagnostics(),
|
...angularCompiler.getOptionDiagnostics(),
|
||||||
...builder.getOptionsDiagnostics(),
|
...builder.getOptionsDiagnostics(),
|
||||||
...builder.getGlobalDiagnostics(),
|
...builder.getGlobalDiagnostics(),
|
||||||
...builder.getSyntacticDiagnostics(),
|
|
||||||
];
|
];
|
||||||
diagnosticsReporter(diagnostics);
|
diagnosticsReporter(diagnostics);
|
||||||
|
|
||||||
// Collect semantic diagnostics
|
// Collect source file specific diagnostics
|
||||||
for (const sourceFile of builder.getSourceFiles()) {
|
for (const sourceFile of builder.getSourceFiles()) {
|
||||||
if (!ignoreForDiagnostics.has(sourceFile)) {
|
if (!ignoreForDiagnostics.has(sourceFile)) {
|
||||||
|
diagnosticsReporter(builder.getSyntacticDiagnostics(sourceFile));
|
||||||
diagnosticsReporter(builder.getSemanticDiagnostics(sourceFile));
|
diagnosticsReporter(builder.getSemanticDiagnostics(sourceFile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user