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: TypeScript
typescripttypesconsistency
Match an object's shape to the existing canonical type
When building an object that should conform to an established type (e.g. Ticker), include the type's required fields and reuse the type rather than a partial ad-hoc shape.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codets
| 1 | ticker: { id: number; name: string; fullname: string; logo: string | null } | null |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | ticker: Ticker | null // includes insref, isin, instrumentType, marketplace, ... |
Explanation (EN)
Objašnjenje (HR)