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: universal
namingapi-designdefaultsbooleans
Name boolean flags so the common case needs no prop
If a behavior is on by default, name the flag for the opt-out (hideWordCount) instead of the opt-in (displayWordCount) so callers don't have to pass it in the common case.
PR: hegnar-journalist-boost · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | <Editor displayWordCount={true} /> // has to be passed everywhere |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <Editor /> // word count shown by default |
| 2 | <Editor hideWordCount /> // opt out only where needed |
Explanation (EN)
Objašnjenje (HR)