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
error-handlingcleanupstyle
Omit the error binding in catch when unused
Use an optional catch binding (catch { }) when the error object is not used, instead of declaring an unused parameter.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codets
| 1 | try { |
| 2 | return await fetchData(); |
| 3 | } catch (e) { |
| 4 | return null; |
| 5 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | try { |
| 2 | return await fetchData(); |
| 3 | } catch { |
| 4 | return null; |
| 5 | } |
Explanation (EN)
Objašnjenje (HR)