ESLint error when using optional catch binding
It's an ES2019 feature, so make sure you set an ecmaVersion
of 10. For example, your .eslintrc.json
should have:
{
"parserOptions": {
"ecmaVersion": 10
}
}
Setting parser options helps ESLint determine what is a parsing error.
Similarly, for the online demo, make sure to select 2019
from the "ECMA Version" dropdown list.