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 ruleP2universalStack: typescript
function-signaturereadabilityboolean-trap
Use a named options object instead of a bare positional boolean flag
Replace a trailing positional boolean argument with an options object so the call site documents intent (resetTicker: true) instead of an opaque true.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | const handleCategoryChange = (id?: number, urlname?: string, resetTicker?: boolean) => { /* ... */ }; |
| 2 | handleCategoryChange(id, urlname, true); // what is true? |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | const handleCategoryChange = (id?: number, urlname?: string, options: { resetTicker?: boolean } = {}) => { /* ... */ }; |
| 2 | handleCategoryChange(id, urlname, { resetTicker: true }); |
Explanation (EN)
Objašnjenje (HR)