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 ruleP1universalStack: JavaScript
correctnessconditionalslogicreadability
Don't write logically redundant or impossible condition combinations
Review combined conditions for contradictions (e.g. value === 'null' && value.length < 1) and simplify to what you actually mean.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codets
| 1 | if (typeof v === 'string' && v === 'null' && v.length < 1) { /* never true */ } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | if (typeof v === 'string' && (v === 'null' || v === '')) { /* ... */ } |
Explanation (EN)
Objašnjenje (HR)