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
enumsnamingclaritytypescript
Name or comment special-case enum members precisely
If an enum member only applies to a specific case (one vendor, one mode), make the name reflect that or add a comment, so future readers don't assume broader applicability.
PR: vinify-frontend · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | export enum DetailsFields { |
| 2 | POS_MENU_BOTTLE = 'posMenuBottle', // actually only for one POS vendor |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | export enum DetailsFields { |
| 2 | // NOTE: specific to the Munu POS, not all POS systems |
| 3 | MUNU_MENU_BOTTLE = 'posMenuBottle', |
| 4 | } |
Explanation (EN)
Objašnjenje (HR)