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).
backend ruleP2universalStack: TypeScript
mappingdryclean-code
Use a pick helper to map a subset of identical properties
When a mapper copies several same-named properties, use a pick utility (e.g. lodash pick) instead of listing each assignment manually.
PR: vinify-backend · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | return { |
| 2 | id: pricingGroup.id, |
| 3 | name: pricingGroup.name, |
| 4 | cellarId: pricingGroup.cellarId, |
| 5 | }; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | return pick(pricingGroup, ['id', 'name', 'cellarId']); |
Explanation (EN)
Objašnjenje (HR)