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).
backend ruleP1stack specificStack: typescript
typescriptinterfacestypesdata-modeling
Type a list field as an array of the element shape, not a single-element tuple
Model collections as ElementType[] rather than a one-element array literal of an inline object.
PR: hegnar-web · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | interface Offers { |
| 2 | offers: [ |
| 3 | { |
| 4 | name: string; |
| 5 | isMultipublication?: boolean; |
| 6 | } |
| 7 | ]; |
| 8 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | interface Offer { |
| 2 | name: string; |
| 3 | isMultipublication?: boolean; |
| 4 | } |
| 5 |
|
| 6 | interface Offers { |
| 7 | offers: Offer[]; |
| 8 | } |
Explanation (EN)
Objašnjenje (HR)