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
namingenumsstate-machinereadability
Name state enum members by their meaning
Choose enum member names that describe the state (idle, success, rejection) rather than an incidental detail; success/confirmed is clearer than reusing 'error' as feedback.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | enum Stage { CLOSED, INITIAL, ERROR } |
| 2 | // 'error' used as the success/feedback state too |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | enum Stage { IDLE, INITIAL, CONFIRMED, REJECTION } |
Explanation (EN)
Objašnjenje (HR)