Diagnose and improve Angular codebases with a single command.
Angular Doctor scans your project for Angular-specific lint issues and dead code, then produces a 0–100 health score plus actionable diagnostics.
- Angular-aware linting (components, directives, pipes, performance, architecture, TypeScript)
- Dead code detection (unused files, exports, types) via knip
- Workspace support (Angular CLI + npm/pnpm workspaces)
- Diff mode to scan only changed files
- Markdown reports for sharing results
Run at your Angular project root (or workspace root):
npx -y angular-doctor@latest .Generate a Markdown report in the current directory:
npx -y angular-doctor@latest . --report .Show affected files and line numbers:
npx -y angular-doctor@latest . --verboseTeach your coding agent to run Angular Doctor automatically after every Angular change:
curl -fsSL https://raw.githubusercontent.com/antonygiomarxdev/angular-doctor/main/install-skill.sh | bashSupports Cursor, Claude Code, Windsurf, Amp Code, Codex, Gemini CLI, and OpenCode.
Once installed, your agent will automatically run:
npx -y angular-doctor@latest . --verbose --diff…after making Angular changes, catching issues before they reach review.
Angular Doctor automatically detects multiple projects:
- Angular CLI workspaces — reads
angular.jsonand scans each project insideprojects/ - npm / pnpm workspaces — detects packages with
@angular/corefromworkspacesorpnpm-workspace.yaml
When multiple projects are found:
- Interactive mode: prompts for which projects to scan
- Non-interactive mode (
-y, CI): scans all detected projects
Target a specific project (comma-separated for multiple):
npx -y angular-doctor@latest . --project my-app,my-libUsage: angular-doctor [directory] [options]
Options:
-v, --version display the version number
--no-lint skip linting
--no-dead-code skip dead code detection
--verbose show file details per rule
--score output only the score
--report [path] write a markdown report (optional output path)
--fast speed up by skipping dead code and type-aware lint
-y, --yes skip prompts, scan all workspace projects
--project <name> select workspace project (comma-separated for multiple)
--diff [base] scan only files changed vs base branch
-h, --help display help for command
Use --report to write a Markdown report:
--reportwrites to the diagnostics temp folder--report .writes to the current project directory--report ./reportswrites to a custom folder--report ./reports/scan.mdwrites to a specific file
Create an angular-doctor.config.json in your project root:
{
"ignore": {
"rules": ["@angular-eslint/prefer-standalone"],
"files": ["src/generated/**"]
}
}Or use the angularDoctor key in package.json:
{
"angularDoctor": {
"ignore": {
"rules": ["@angular-eslint/prefer-standalone"]
}
}
}| Key | Type | Default | Description |
|---|---|---|---|
ignore.rules |
string[] |
[] |
Rules to suppress using the plugin/rule format |
ignore.files |
string[] |
[] |
File paths to exclude, supports glob patterns |
lint |
boolean |
true |
Enable/disable lint checks |
deadCode |
boolean |
true |
Enable/disable dead code detection |
verbose |
boolean |
false |
Show file details per rule |
diff |
`boolean | string` | — |
import { diagnose } from "angular-doctor/api";
const result = await diagnose("./path/to/your/angular-project");
console.log(result.score); // { score: 82, label: "Great" }
console.log(result.diagnostics); // Array of Diagnostic objects
console.log(result.project); // Detected framework, Angular version, etc.Each diagnostic has the following shape:
interface Diagnostic {
filePath: string;
plugin: string;
rule: string;
severity: "error" | "warning";
message: string;
help: string;
line: number;
column: number;
category: string;
}- Missing
Component/Directiveclass suffixes - Empty lifecycle methods
- Missing lifecycle interfaces
- Pipe not implementing
PipeTransform
- Missing
OnPushchange detection strategy - Outputs shadowing native DOM events
- Conflicting lifecycle hooks (
DoCheck+OnChanges) - Use of
forwardRef - Renamed inputs/outputs
- Inline
inputs/outputsmetadata properties - Non-standalone components (Angular 17+)
- Explicit
anyusage
- Unused files
- Unused exports and types
Inspired by react-doctor.
MIT
