ggascoigne / prettier-plugin-import-sort

Prettier plugin to pass javascript and typescript through import-sort
MIT License
110 stars 11 forks source link

Support for cleaning unused imports #4

Closed KerryRitter closed 3 years ago

KerryRitter commented 4 years ago

It would be fantastic if this plugin could detect and remove unused imports ala VS Code and/or TS Hero extension.

Thanks so much for making this! Been dying for it :)

mym0404 commented 4 years ago

@KerryRitter you can use a macro in WebStorm like the following picture.

image

Then, you can assign your keymap to this macro. It is so convenient.

kekel87 commented 4 years ago

We are very interested in this feature too. The purpose of this plugins for us and not to depend on an IDE.

grumd commented 3 years ago

This is a plugin for sorting imports. I think removing unused imports is out of scope for this plugin.

ggascoigne commented 3 years ago

Honestly I agree with all of you. I use IntelliJ and just have a macro to run both rather like the one @mym0404 suggested. But I'll admit that I do rather like the idea about having the feature which is why I left this open for so long.

That said, this plugin really doesn't do any of the heavy lifting itself, it's just a bridge between import-sort and prettier. If that feature were to be added then it would make sense for it to come from import-sort rather than this plugin.

As such, I'm going to close this issue and suggest that the conversation happen over at https://github.com/renke/import-sort.