Autofix for no-unused-vars "caughtErrors: all"
See original GitHub issueThe version of ESLint you are using. 5.16
The problem you want to solve.
We currently have to manually fix caughtErrors: all
errors even when we give "ecmaVersion": 2019
.
Your take on the correct solution to problem.
ESLint could automatically fix this by removing catch bindings.
Are you willing to submit a pull request to implement this change?
Yes if I learn how to implement an autofix.
This is basically #10434 but based on the existing rule.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
no-unused-vars - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >The 3 Best ESLint No-Unused-Vars Option Settings (Make it ...
The no-unused-vars rule is one of the most important ESLint rules for ... 3 No-Unused-Vars caughtErrors: Require Catch to Use All Named Vars....
Read more >ESLint - Configuring "no-unused-vars" for TypeScript
VS Code, using eslint, was giving me warnings about unused variables in my type declarations for function callbacks. These options, added to my ......
Read more >Improving the User Experience for Unused Variables : r/Zig
By fixing the unused variable errors in the code, you can now work with --autofix on all the time and your users will...
Read more >Fix most of the remaining no-unused-vars issues for local ...
This fixes most of the no-unused-vars for local scope in browser/. There's only a handful of issues left, but they either need other...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We generally only autofix a rule when we’re sure of what the user intended to do. With
no-unused-vars
, sometimes an unused variable indicates that the user has a bug in their code because they meant to use the variable. So if we “fix” the problem by deleting the variable, we might end up just concealing the bug because the problem will no longer be brought to the user’s attention.Could that be enabled via an explicit option of the rule?