You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## <aname="no-unused-vars"></a> `no-unused-vars` now defaults `caughtErrors` to `"all"`
367
+
368
+
ESLint v9.0.0 changes the default value for the `no-unused-vars` rule's `caughtErrors` option.
369
+
Previously it defaulted to `"none"` to never check whether caught errors were used.
370
+
It now defaults to `"all"` to check caught errors for being used.
371
+
372
+
```js
373
+
/*eslint no-unused-vars: "error"*/
374
+
try {}
375
+
catch (error) {
376
+
// 'error' is defined but never used
377
+
}
378
+
```
379
+
380
+
**To address:** If you want to allow unused caught errors, such as when writing code that will be directly run in an environment that does not support ES2019 optional catch bindings, set the `caughtErrors` option to `"none"`.
0 commit comments