-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
Add eslint-plugin-unused-imports
to disallow unused imports
#766
Comments
An alternative solution is to use knip for that: https://knip.dev/ |
I like knip but it's heavy handed for small projects (it also attempts to delete files you're not using right now, but don't hurt keeping them around) This could easily be part of eslint and I don't know why it isn't. It seems that it should be part of They did reject removing the whole - import {log, unused} from 'x'
+ import {log} from 'x'
log(123) |
I misread the original issue, I thought it was about removing them from package.json. ESLint itself seems to generally dislike autofixing of this rule: typescript-eslint/typescript-eslint#7877 Because they think it's poor DX when a user has format on save on (I didn't realize that the two things the mentioned plugin in does is to split rule for imports from other undefined vars and enabling auto fix for it) |
I noticed that my imports are not being trimmed once I stop using a certain function. Any particular reason?
https://www.npmjs.com/package/eslint-plugin-unused-imports
The text was updated successfully, but these errors were encountered: