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).
fullstack ruleP2stack specificStack: TypeScript
typescriptconsistencynamingconventions
Pick interface vs type by convention and apply it uniformly
Decide a project convention for when to use interface vs type alias (and the I/T prefix), then apply it consistently; don't let an auto-fixer flip type to interface while leaving a T-prefixed name.
PR: hegnar-ws · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | export interface TPortfolioData { ... } // 'T' prefix on an interface |
| 2 | type IBreakpointSizes = Record<string, ISize>; // 'I' prefix on a type alias |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | export interface IPortfolioData { ... } |
| 2 | type TBreakpointSizes = Record<string, ISize>; |
Explanation (EN)
Objašnjenje (HR)