Overview
A command-line health scan for Angular CLI and Nx workspaces. It reads your source, scores it from 0 to 100, and writes a report you can fix from.
- 1
Run the scan
One command in your project root. No install, no config.
npx @abiramcodes/angular-doctor@latest - 2
Read the score
A 0–100 score, a health meter, and findings grouped by severity.
npx @abiramcodes/angular-doctor@latest --verbose - 3
Fix what changed
Re-scan after edits. The report lists each finding with a suggested fix when the rule has one.
npx @abiramcodes/angular-doctor@latest --scope changed
What it is
Angular Doctor is a command-line health scan for an Angular CLI or Nx workspace. Run it in the project and it reads the source, prints a score from 0 to 100, and lists what it found.
An error costs 1.5 points in each file where that rule fires. The same error twice in one file still costs 1.5. A warning costs 0.75 once per rule, even when it appears in many files. A note costs nothing. The score starts at 100 and does not go below 0.
TypeScript goes through Oxlint. Built-in rules cover Angular habits those linters do not: inject(), host bindings, control flow, secrets in client code, accessibility gaps, and similar checks. A curated set of Angular template rules runs over standalone and inline templates. The scan sits next to the lint setup you already run. It does not replace a build or your tests.
How it works
Find the workspace
It starts in the directory you pass, or the current directory, and walks up to 12 parents looking for angular.json or nx.json. If it finds neither, it stops and says no Angular workspace was detected. Angular 17 and newer get every check. Angular 15 and 16 scan in compat mode, with rules that need newer Angular switched off. Older than 15 stops with a clear message.
Choose files
Full scope reads TypeScript and HTML, skipping node_modules, dist, .angular, coverage, and spec files. Changed scope reads git status, so staged, unstaged, and untracked files count, and a clean tree scans nothing. Files scope reads only the TypeScript and HTML paths you pass. Contextual scope keeps files under the same top-level folder as each seed, so a seed in src/ keeps the src tree.
Check and score
Built-in rules run on the source, then Oxlint runs on the TypeScript. An error costs 1.5 in each file. A warning costs 0.75 once per rule. Filtering with --category changes which findings are printed. The score stays the full scan.
Print, then write
In a terminal, a progress line runs on stderr and clears before the summary. You then get the project, the Angular version, the duration, a health meter, and findings grouped once per rule under errors, warnings, and info. If anything was found, including a note that does not lower the score, it writes angular-doctor-report.md. With --html it also writes a self-contained angular-doctor-report.html with category tabs and a severity filter. A scan with no findings prints the summary and does not write those files.