question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add fix/suggestions to `no-unused-vars` rule

See original GitHub issue

What rule do you want to change?

Add fix or suggestions to no-unused-vars.

Does this change cause the rule to produce more or fewer warnings?

No

How will the change be implemented? (New option, new default behavior, etc.)?

Not sure, but I think at least some variables not has side effect can be safely removed.

Please provide some example code that this change will affect:

const foo = 1
import fs from 'fs'

What does the rule currently do for this code?

No fix, no suggestions.

What will the rule do after it’s changed?

Auto-fix errors or at least has suggestions.

Are you willing to submit a pull request to implement this change?

Maybe.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mdjermanoviccommented, May 24, 2021

Imagine a codebase needing to be cleaned up with a lot of unused vars

Maybe the autofix/no-unused-vars rule from eslint-plugin-autofix can be helpful for this use case.

1reaction
nzakascommented, May 22, 2021

@tchakabam we don’t have a way to optionally apply auto fixes in this way. Suggestions is intended primarily for the editor use case, so that also doesn’t solve your problem of wanting to remove all unused variables in a codebase. I suppose we could provide the suggestions and you could write a tool on top of ESLint that uses that data to apply the fixes, but I don’t see us adding a way to do this type of mass variable removal in the core.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Answering Dealers' Questions about the Revised Used Car Rule
The revised Buyers Guide recommends that consumers get a vehicle history report before buying a used car and sends them to ftc.gov/usedcars for ......
Read more >
Possessive Nouns
3 Rules to Make Possessives. • Rule 1: To form the possessive of a singular noun, add an apostrophe and s ('s) =...
Read more >
6. Compounding Rules A compound word is a union of two or ...
A compound word is a union of two or more words, either with or without a hyphen. It conveys a unit idea that...
Read more >
Used Car Lemon Law Fact Sheet
Your dealer must give you a written lemon-law warranty; Under the lemon-law warranty, the dealer must repair any defect in the covered parts,...
Read more >
Nouns, Lesson 8: Possessive Nouns - English Grammar 101
Add 's to singular words to show possession. Dog's collar, sister's backpack, car's engine. (dog + 's), (sister + 's), (car ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found