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 ruleP2universalStack: JavaScript/TypeScript
namingobjectsreadability
Name object-key iteration variables key, not id
When iterating object keys or using a value as a map key, name the variable key/linkKey rather than id; id implies a record identifier.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codets
| 1 | linkIds.map(linkId => { const cfg = linkConfigById[linkId]; }); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | linkKeys.map(linkKey => { const cfg = linkConfigByKey[linkKey]; }); |
Explanation (EN)
Objašnjenje (HR)