prefer-optional-catch-binding

March 27, 2026 ยท View on GitHub

๐Ÿ“ Prefer omitting the catch binding parameter.

๐Ÿ’ผ This rule is enabled in the following configs: โœ… recommended, โ˜‘๏ธ unopinionated.

๐Ÿ”ง This rule is automatically fixable by the --fix CLI option.

If the catch binding parameter is not used, it should be omitted.

Examples

// โŒ
try {} catch (notUsedError) {}

// โŒ
try {} catch ({message}) {}

// โœ…
try {} catch {}