Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-unused-vars: remove unused imports #7619

Closed
fab1an opened this issue Nov 18, 2016 · 3 comments
Closed

no-unused-vars: remove unused imports #7619

fab1an opened this issue Nov 18, 2016 · 3 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules

Comments

@fab1an
Copy link

fab1an commented Nov 18, 2016

It would be awesome if eslint could automatically --fix unused es6 imports instead of reporting them as unused variables.

Is this feasible?

Thank you!

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Nov 18, 2016
@mysticatea
Copy link
Member

Thank you for this issue.

But I don't think it's feasible.
ESLint cannot distinguish whether people will use the unused variables after the autofix.

@mysticatea mysticatea added enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Nov 18, 2016
@not-an-aardvark
Copy link
Member

not-an-aardvark commented Nov 19, 2016

This would also prevent the imported files from getting evaluated, which will cause code to break if the modules have side-effects.

@vitorbal
Copy link
Member

Thanks for the issue!
Looks like the team doesn't feel in favor of autofixing no-unused-vars, so I'm gonna go ahead and close this.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

5 participants