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).
backend ruleP2universalStack: typescript
readabilityredundancyconditionals
Drop redundant truthiness checks on already-falsy values
Do not add an extra emptiness check around a value whose falsy state already covers the case; an empty string, 0, or null is already falsy.
PR: vinify-backend · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetypescript
| 1 | if (name !== '' && name) { |
| 2 | use(name); |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | if (name) { |
| 2 | use(name); |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)