Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Don't pass empty strings to clsx/className helpers
Omit no-op empty-string arguments to a verified class utility; inspect attribute/default-prop semantics before removing an empty className.
Bad example
| 1 | className={clsx('', condition && 'ml-auto')} |
Explanation (EN)
A separate empty-string utility argument adds no class and obscures the meaningful arguments.
Objašnjenje (HR)
Good example
| 1 | className={clsx(condition && 'ml-auto')} |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
Remove literal empty-string arguments from the known class-combination utility when they contribute no classes and no meaningful side effects.
Exceptions / Tradeoffs (EN)
An explicit className="" can differ from an omitted attribute or a custom component's default prop. A ternary empty branch may be required by its type or existing convention.