Skip to content

Extended diagnostics in compiler #42966

@dgp1130

Description

@dgp1130

Which @angular/* package(s) are relevant/releated to the feature request?

compiler-cli

Description

The compiler should have some capability for "extended template diagnostics", meaning diagnostics applied after type checking. Currently, the compiler doesn't really have any warnings, and only ever fails for fatal issues that directly prevent compilation (with some minor exceptions). These extended diagnostics will allow warnings to be easily authored to check for smaller mistakes like getting two-way binding syntax backwards ([foo])="bar" or having extraneous operators like using foo ?? 'bar' when foo is not nullable.

For scoping, we just need a private flag in the compiler for now. This will be enough for the CLI and language service to plug in and surface these diagnostics.

Proposed solution

A new private flag in the compiler which enables "extended template diagnostic" checks that give warning/information diagnostics about user templates which aren't strictly fatal errors. This issue is mostly about building the required infrastructure, but we should include one or two simple checks to validate the system.

Alternatives considered

N/A

Metadata

Metadata

Assignees

Labels

area: compilerIssues related to `ngc`, Angular's template compilerfeatureLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under consideration

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions