prefer-optional-catch-binding
UnreleasedConfiguration
rslint.config.ts
Rule Details
Omit unused catch bindings. A reference from a nested scope counts as a use, as do writes to the caught variable.
Unused destructuring bindings are also checked. Comments surrounding the binding are preserved; a binding containing comments is reported without an automatic fix. Binding defaults are not removed.
Examples of incorrect code:
Examples of correct code:
Options
This rule has no options. It is enabled at error severity in unicornPlugin.configs.recommended.