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: javascript
readabilityboolean-parameterclarity
Name a boolean argument with a constant instead of passing a bare true
A bare true/false at a call site hides the parameter's meaning; assign it to a self-describing constant first.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codejavascript
| 1 | upcomingReports: mapToReports(items, true), |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejavascript
| 1 | const isUpcomingReport = true; |
| 2 | upcomingReports: mapToReports(items, isUpcomingReport), |
Explanation (EN)
Objašnjenje (HR)