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 ruleP2stack specificStack: react
reactpropsconstantsreadability
Import shared constants directly rather than passing them as props
When a value is a static importable constant, import it where it is used instead of threading it through props.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetsx
| 1 | <Top50Table headers={headers} /> |
| 2 | // headers is a static constant defined in a config module |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | // inside Top50Table |
| 2 | import { headers } from './top50TableConfig'; |
Explanation (EN)
Objašnjenje (HR)