prettier-plugin-sort-imports
prettier-plugin-sort-imports copied to clipboard
add option to put `import type` statements at the top
I have the following imports:
import type { ComponentProps } from 'svelte';
import { writable } from 'svelte/store';
import type Modal from './Modal.svelte';
And I'd like some configuration to sort all the import type
statements at the top, like this:
import type { ComponentProps } from 'svelte';
import type Modal from './Modal.svelte';
import { writable } from 'svelte/store';
Would also be nice if we could configure type imports to be separated by group.
import type { foo } from 'some-lib'
import type { bar } from 'other-lib'
import type { baz } from '@/baz'
import qux from 'some-lib'
import quux from '@/quux'
We had this in #153 and it will be released in the next major version. We released it in v4.1.0 mistakenly and reverted it later on.
If you still like to try then install v4.1.0 and use importOrder: ["<THIRD_PARTY_TS_TYPES>", "^[./]", "<TS_TYPES>^[./]"],
Possible to re-include types for a 4.x version? I would like to update prettier to v3
Thanks :)
Would this also work when using the import { type Something } ...
syntax?
I join in the wait. I would like to have the type sorting function available using prettier 3.
Any news on this?
Is this feature ever available on any public releases? I cannot wait to use this nice stuff.
Any updates ?