Rules Hub
Coding Rules Library
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Remove stale file-header comments and leftover dev notes
Strip out comments that name the wrong file, large commented-out blocks, and throwaway dev/scratch notes; keep only comments that explain current intent.
Bad example
| 1 | // company-layout.tsx <-- actual file is layout.tsx |
| 2 | import ... |
| 3 |
|
| 4 | tagDisplayName: string | null; // valjda |
| 5 | // dodat ovde jos 3 rute, zasad ih copy pasteat sve |
Explanation (EN)
A wrong filename header, a vague non-English scratch note, and a copy-paste reminder all mislead and rot as the code evolves.
Objašnjenje (HR)
Krivi naziv datoteke u zaglavlju, nejasna biljeska na drugom jeziku i podsjetnik za copy-paste svi zavaravaju i trunu kako se kod razvija.
Good example
| 1 | import ... |
| 2 |
|
| 3 | tagDisplayName: string | null; |
Explanation (EN)
Noise comments are removed; what remains is code whose intent is clear without stale annotations.
Objašnjenje (HR)
Komentari-suma su uklonjeni; ostaje kod cija je namjera jasna bez zastarjelih biljeski.
Exceptions / Tradeoffs (EN)
Keep TODO/FIXME comments that track real, intended work — ideally with a linked issue.
Iznimke / Tradeoffi (HR)
Zadrzi TODO/FIXME komentare koji prate stvaran, namjeravan posao — idealno s povezanim issueom.