Title: Expose stable machine-readable Angular build diagnostics · Issue #33121 · angular/angular-cli · GitHub
Open Graph Title: Expose stable machine-readable Angular build diagnostics · Issue #33121 · angular/angular-cli
X Title: Expose stable machine-readable Angular build diagnostics · Issue #33121 · angular/angular-cli
Description: CLI tool for Angular. Contribute to angular/angular-cli development by creating an account on GitHub.
Open Graph Description: CLI tool for Angular. Contribute to angular/angular-cli development by creating an account on GitHub.
X Description: CLI tool for Angular. Contribute to angular/angular-cli development by creating an account on GitHub.
Opengraph URL: https://github.com/angular/angular-cli
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Expose stable machine-readable Angular build diagnostics","articleBody":"### Which @angular/* package(s) are relevant/related to the feature request?\n\ncompiler-cli\n\n### Description\n\nLarge Angular codebases often want to enable stricter compiler checks, especially `strictTemplates` and extended diagnostics, but cannot fix all existing diagnostics in one migration.\n\nAngular already supports category-based strictness ratcheting through template type-checking flags. That helps when a whole category of checks is too noisy.\n\nIt does not solve the case where a team wants a check enabled, but wants to treat existing diagnostics as migration debt while preventing new diagnostics from being introduced.\n\nTeams can build this externally by parsing `ng build` output, but text output is not a stable API. Angular diagnostics can include template source spans and compiler-specific formatting, which makes external parsing fragile.\n\nThis is not a request for `strictTemplates` warning mode. A previous discussion in [https://github.com/angular/angular/issues/55868](https://github.com/angular/angular/issues/55868) explained why warning mode is not a good fit for `strictTemplates`, especially because template type-checking often produces TypeScript diagnostics from generated template-checking code.\n\nThis request is only about exposing stable diagnostic output so external tooling can implement baseline/ratchet workflows reliably.\n\n\n### Proposed solution\n\nExpose stable machine-readable diagnostics from Angular CLI builds.\n\nFor example:\n\n```bash\nng build my-app --configuration strict-check --diagnostics-format json\n```\n\nor:\n\n```bash\nng build my-app --configuration strict-check --diagnostics-output angular-diagnostics.json\n```\n\nThe exact CLI/API shape is not important. The important part is that `ng build` can emit stable, machine-readable diagnostics.\n\nExample shape:\n\n```jsonc\n{\n \"diagnostics\": [\n {\n \"code\": \"NG8002\",\n \"category\": \"error\",\n \"source\": \"angular-template\",\n \"message\": \"Can't bind to ...\",\n \"file\": \"libs/example/src/example.component.html\",\n \"startLine\": 12,\n \"startColumn\": 7,\n \"endLine\": 12,\n \"endColumn\": 28,\n \"relatedInformation\": []\n }\n ]\n}\n```\n\nThe schema should include enough stable information for tools to compare diagnostics across runs, such as diagnostic code, category/severity, source, file, source span, message, and related information when available.\n\nThis would enable external workflows like:\n\n```bash\nng build my-app --configuration strict-check --diagnostics-output angular-diagnostics.json\nangular-baseline check angular-diagnostics.json\n```\n\nThat allows teams to create a migration ratchet:\n\n* Existing diagnostics are treated as migration debt.\n* New diagnostics fail CI.\n* Fixed diagnostics can be removed from the baseline.\n* The codebase becomes stricter over time.\n\nThis is similar in spirit to `tsc-baseline` or ESLint bulk suppressions, but for Angular compiler and template diagnostics.\n\n\n### Alternatives considered\n\n## Use existing template strictness flags\n\nAngular's existing strictness flags are useful for category-based rollout.\n\nHowever, disabling a category allows both existing and new violations in that category.\n\nA diagnostic baseline lets a team keep the check enabled while allowing only known existing diagnostics.\n\n## Parse `ng build` text output\n\nTeams can parse `ng build` output today, but this is fragile because CLI text output is optimized for humans, not long-term machine consumption.\n\n## Add first-class Angular diagnostic baselines\n\nAngular could provide a full diagnostic baseline feature directly, for example:\n\n```bash\nng build my-app --configuration strict-check --update-diagnostic-baseline\nng build my-app --configuration strict-check --diagnostic-baseline angular-diagnostics.baseline.json\n```\n\nThat would be useful, but stable machine-readable diagnostics would already allow the ecosystem to build this externally.\n","author":{"url":"https://github.com/OmerGronich","@type":"Person","name":"OmerGronich"},"datePublished":"2026-05-04T13:22:31Z","url":"https://github.com/angular/angular-cli/issues/33121"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:36594d6b-9d2f-cf2e-60b8-aff9b6df6390 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C3DC:D1D28:103556E:158D62D:6B01E031 |
| html-safe-nonce | 4dfbd7beaf7f6b57781f972578c2618749c05c46e39f9587a75744a294ce4fef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDM0RDOkQxRDI4OjEwMzU1NkU6MTU4RDYyRDo2QjAxRTAzMSIsInZpc2l0b3JfaWQiOiI1MTY4NzYyMzk5NzA4Mjc0NzM3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 899c742583d61f7987a33ca426053f1abc4492c69b3d94d509d8f05de1904420 |
| hovercard-subject-tag | repository:36891867 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/angular/angular-cli/issues/33121 |
| twitter:image | https://repository-images.githubusercontent.com/36891867/7600907d-5c07-47a5-a7b5-80b9c8922d6c |
| twitter:card | summary_large_image |
| og:image | https://repository-images.githubusercontent.com/36891867/7600907d-5c07-47a5-a7b5-80b9c8922d6c |
| og:image:alt | CLI tool for Angular. Contribute to angular/angular-cli development by creating an account on GitHub. |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-cache |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width