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
enumyagnisimplicity
Do not introduce an enum with a single member
A one-member enum adds ceremony without value; use it only when you genuinely expect more members soon, otherwise use a plain constant.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | export enum ProviderType { |
| 2 | DEFAULT = 'default', |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | export const PROVIDER_TYPE = 'default'; |
Explanation (EN)
Objašnjenje (HR)