Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP2stack specificStack: typescript
typescriptdead-codetypescleanliness
Don't declare types you don't use
Only define type/interface declarations that are actually referenced; unused declarations are noise that readers must wade through.
PR: hegnar-bellsheep-web · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetypescript
| 1 | interface LivewrappedOptions { /* never referenced anywhere */ } |
| 2 | type TCFAPIFunction = (cmd: string) => void; // unused |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // declare only the globals/types the code actually consumes |
Explanation (EN)
Objašnjenje (HR)