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: javascript
readabilityconditionalsshorthand
Use a falsy check for empty strings instead of explicit comparison
An empty string is already falsy, so guard with the value directly rather than comparing against ''.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codejsx
| 1 | {value !== '' && <Component value={value} />} |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejsx
| 1 | {value && <Component value={value} />} |
Explanation (EN)
Objašnjenje (HR)