simonhaenisch/prettier-plugin-organize-imports

Sorting does not work if newline between imports

povilasDadelo opened this issue · 1 comments

@simonhaenisch I have noticed that if there is a newline between imports sorting doesn't work. Is this by design?

P.s. very cool plugin

Yes it's by design in the TypeScript API... it's a feature introduced in version 4.7, called "group-aware organize imports":

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#group-aware-organize-imports

(i.e. it still sorts, but just within each group, and groups are separated by empty newlines)