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
design-tokensorderingreadabilityunion-types
Insert new design-token variants in their natural scale order
When adding a new shade/size token to an enum or union, position it within the existing ordered scale rather than appending it at the end.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | type ColorVariant = 'grey-dark' | 'grey-600' | 'grey-700' | 'grey-900' | 'red-500' | 'grey-500'; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | type ColorVariant = 'grey-dark' | 'grey-500' | 'grey-600' | 'grey-700' | 'grey-900' | 'red-500'; |
Explanation (EN)
Objašnjenje (HR)