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: typescript
propsorderingreadabilityconventions
List required props before optional ones in component/type definitions
Order props/parameters with required ones first and optional ones after for consistency and readability.
PR: hegnar-web · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetypescript
| 1 | interface Props { |
| 2 | className?: string; |
| 3 | logo: string; |
| 4 | alt?: string; |
| 5 | name: string; |
| 6 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | interface Props { |
| 2 | logo: string; |
| 3 | name: string; |
| 4 | className?: string; |
| 5 | alt?: string; |
| 6 | } |
Explanation (EN)
Objašnjenje (HR)