I\'m trying to remove unused imports and declarations as answered in this SO thread for Angular. I\'m trying to achieve the goal using eslint-plugin-react, but not found any opt
Using unused-imports plugin and unused-imports/no-unused-imports-ts
rule, eslint --fix
will remove the import
s.
Here is an example repo which --fix
removes the unused import
s.
https://github.com/moshfeu/eslint-ts-unused-imports
eslint has a built-in fix option.
eslint ... --fix
If rules
contains no-unused-vars
, eslint will "fix" the unused import by removing them (along with other auto fixes).