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: JavaScript
readabilitydestructuringclean-code
Avoid deeply nested destructuring; destructure one level directly
Triple-nested destructuring forces the reader to parse in reverse; pull the value with a short direct path instead.
PR: hegnar-components · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | const { |
| 2 | currentTarget: { |
| 3 | dataset: { category }, |
| 4 | }, |
| 5 | } = event; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | const { category } = event.currentTarget.dataset; |
Explanation (EN)
Objašnjenje (HR)