daidodo / format-imports-vscode

Format imports and exports for JavaScript and TypeScript in VS Code.
https://marketplace.visualstudio.com/items?itemName=dozerg.tsimportsorter
MIT License
62 stars 5 forks source link

Keep unused imports on demand #62

Open mxmzb opened 2 years ago

mxmzb commented 2 years ago

Sometimes I'm playing with packages or code. I might comment or delete a line just temporary, with the intention to bring it back. However, this plugin will remove the unused package immediately, and I need to reimport the package manually again.

Therefore, I wish there was an option to disable just the removal of unsuded packages on save, or manually trigger this action.

Note, that this can not be achieved with keepUnused config key, because that will prevent the plugin to remove the listed packages at all times. I just want fine grained control about when I run the action, not change the behavior of the action itself.

daidodo commented 2 years ago

Thanks for the feedback!

I'll add it to the TODO list and come back when available. Meantime, any suggestions or PRs are welcome!