renke / import-sort

Sort ES2015 (aka ES6) imports. Both JavaScript and TypeScript are supported.
ISC License
466 stars 73 forks source link

Combining imports from the same file #138

Open rene-leanix opened 3 years ago

rene-leanix commented 3 years ago

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.

karlhorky commented 3 years ago

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 commented 3 years ago

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