import-sort icon indicating copy to clipboard operation
import-sort copied to clipboard

Combining imports from the same file

Open rene-leanix opened this issue 4 years ago • 2 comments
trafficstars

Have there been any plans to combine all (side-effect-free) imports from the same file into a single import statement?

We're using import-sort in combination with Prettier and would benefit a lot from this feature.

rene-leanix avatar Feb 01 '21 07:02 rene-leanix

I would like this as well.

Currently I'm using VS Code's Organize Imports feature, but it has a huge downside as of Feb 2021 - it removes the unused imports as well 😵 https://github.com/microsoft/TypeScript/issues/36085

karlhorky avatar Feb 02 '21 17:02 karlhorky

Looks like import-sorter from @SoominHan does this, among other features (also with a lot of configuration options for this)! 💯

Using it via the JS/TS Import/Export Sorter VS Code Extension by @daidodo

karlhorky avatar Feb 02 '21 17:02 karlhorky