Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 582 Bytes

no-optional-catch.md

File metadata and controls

32 lines (22 loc) · 582 Bytes

no-optional-catch

This prevents the use of Optional Catch statements.

try {
  ...
} catch { // no argument needed

}

These will not be allowed because they are not supported in the following browsers:

  • Edge < 79
  • Safari < 11.1
  • Firefox < 68
  • Chrome < 66

What is the Fix?

The simplest solution to fix this is to provide the omitted argument:

try {
  ...
} catch (e) { // add the argument

}

This can be safely disabled if you intend to compile code with the @babel/plugin-syntax-optional-catch-binding Babel plugin, or @babel/preset-env.