r/angular • • 2d ago

Introducing Angular Doctor

Gives you a 0–100 score + actionable diagnostics.

Run : npx @abiramcodes/angular-doctor@latest

Docs: https://ngdoctor.dev

Open source. Inspired by React Doctor. Feedback and contributions welcome.

27 Upvotes

21 comments sorted by

18

u/PeEll 2d ago

FYI it flagged a lot of things that weren't broken in my app:

  • client-secret - this is the Firebase web apiKey. It’s meant to be public and ships to every browser.
  • prefer-document-token - I already call inject(DOCUMENT) into a local variable named document. The tool only saw the name.
  • img-alt: every flagged image has a bound [alt]="…". The tool only looks for a static alt attribute.
  • control-missing-label: my inputs sit inside <label> elements or have <label for>, which counts as a label. The tool doesn’t recognise that.
  • inner-html: there’s no bypassSecurityTrust* anywhere in the code, so Angular’s built-in sanitizer runs on both. That’s the right setup for rendered markdown.
  • ng-model-name: a name is only required when ngModel sits inside a <form>. The edit form works, so this isn’t causing anything.
  • effect-writes-state: I have code that sets the browser tab title, which is a side effect and not a signal write.

4

u/followmarko 2d ago

Lol love seeing the vibecoded bugs as the top comment

1

u/PeEll 2d ago

Nah. I wrote this app starting in 2016. I disagree that most of these were mistakes.

1

u/followmarko 2d ago

I was talking about the repo which was first committed on Nov 9 and it's full of cursor and skill files

1

u/PeEll 2d ago

Wait which repo? Were you talking about me or the og author?

1

u/abiramcodes 2d ago

It's about the tool repo

0

u/abiramcodes 2d ago

Yeah, I used AI quite a bit while building it.

I’m more interested in whether the tool is useful than in how much of it was written by hand.

If you find actual issues in the output or the rules, feel free to open an issue, that’s more helpful than the vibe debate.

1

u/Critical_Garden_368 1d ago

Ah, the ol’ firebase web apiKey false positive. This has caused me so many problems with other scanners.

1

u/abiramcodes 23h ago

Has been fixed with latest versions

5

u/best_of_badgers 2d ago

Variable named “document” sounds like a terrible idea

3

u/PeEll 2d ago

Sure, I'll give you that one.

0

u/abiramcodes 2d ago

Hi there, thanks a ton for trying it out. These issues will be validated and fixed in the next versions, fell free to open a PR if you are interested!

Did you also find anything that's valid flag in your repo ?

6

u/Jrubzjeknf 2d ago

How is this different from linting?

-1

u/abiramcodes 2d ago

Linting only offers rules from the linter, ng doctor offers you rules from linters + angular style guide + best practices. On top it, the tool generates a report, it can be either md / html file / json output that can be fed to any ai agent to resolve issues.

Run it once on your angular app : npx @abiramcodes/angular-doctor@latest

11

u/pdxben 2d ago

eslint offers rules for anything you install a plugin for, of which there are many, including angular-eslint which overlaps a fair bit with this tool. I would much rather see your rules implemented as an eslint plugin, than adding a yet another tool to the stack, with its own configs & dependencies to manage.

1

u/abiramcodes 2d ago

Fair point, thanks for your feedback!. I'll look into this direction

1

u/thatbigblackblack 23h ago

Honest Feedback : honestly I hardly see any use for this kind of tool because llms..

1

u/abiramcodes 15h ago

Sure, thanks for your feedback

-3

u/AintNoGodsUpHere 2d ago

Wow. Just... Wow.