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).
fullstack ruleP2universalStack: typescript
api-designreadabilitydead-code
Don't return a value that callers always ignore
If a function's return value is never used, either use it or don't return it, so the signature reflects reality.
PR: hegnar-web · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | function purge(): boolean { /* ... */ return true; } |
| 2 | purge(); // boolean ignored everywhere |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | function purge(): void { /* ... */ } |
| 2 | purge(); |
Explanation (EN)
Objašnjenje (HR)