simonhaenisch/prettier-plugin-organize-imports

Sort default imports and named imports

corradopetrelli opened this issue · 1 comments

Description

Is there a way to sort default imports and named imports in a separated way?

Example

Before:

import A from './a.js'
import { A } from './a1.js'
import B from './b.js'
import { B } from './b1.js'

After:

import A from './a.js'
import B from './b.js'
import { A } from './a1.js'
import { B } from './b1.js'

Nope, the sorting is completely based on the result of the TypeScript language server API's organizeImports method. The point of the plugin is that you don't have to care about the order of imports anymore.

I'm not using this because I like lexical order but because this prevents many merge conflicts because the import section always comes out the same way 🤓 If you want more control over the imports, there's other plugins.