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
typescripttypesconsistencyrefactoring
Type a value consistently through the whole component chain
When you change a prop's type to a domain type, propagate it through every component that passes it so no intermediate link reintroduces a cast.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codets
| 1 | // TabSection uses ReportTabId, but ReportHeader still types activeTab: number -> cast reappears |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | // activeTab: ReportTabId in TabSection, ReportHeader, ReportListWrapperWithTabs and page state |
Explanation (EN)
Objašnjenje (HR)