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: React
namingpropsclarityapi-design
Name props after what they represent, not a borrowed/inaccurate term
A prop holding a dropdown button's visible name is a label, not a placeholder. Name props to describe their actual role so the API reads clearly.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | interface Props { placeholder: string } // it's actually the button label |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | interface Props { label: string } |
Explanation (EN)
Objašnjenje (HR)