Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 542 Bytes

prefer-optional-catch-binding.md

File metadata and controls

29 lines (20 loc) · 542 Bytes

Prefer omitting the catch binding parameter

This rule is part of the recommended config.

🔧 This rule is auto-fixable.

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

Fail

try {} catch (notUsedError) {}
try {} catch ({message}) {}

Pass

try {} catch {}
try {} catch (error) {
	console.error(error);
}