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 ruleP0universalStack: general
namingbooleanscorrectnessrefactoring
When you invert a boolean's name, flip every use of it
Renaming hasNoX to hasX changes its meaning; you must also remove/add the negation at all call sites or the logic inverts silently.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codets
| 1 | // renamed but not flipped -> now means the opposite |
| 2 | const hasHoldings = checkHasHoldings(); |
| 3 | if (!hasHoldings) renderTable(); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | const hasHoldings = checkHasHoldings(); |
| 2 | if (hasHoldings) renderTable(); |
Explanation (EN)
Objašnjenje (HR)