organizeImports
relative imports at the end
#4326
Replies: 6 comments 5 replies
-
That looks good! In my case I would like imports in this order:
|
Beta Was this translation helpful? Give feedback.
-
In my case, I currently use the prettier-plugin-sort-imports plugin of ianvs. And this configuration in my package.json:
The most important setting is "importOrder". The other ones are less important. |
Beta Was this translation helpful? Give feedback.
-
@Conaclos How I can automatically sort on
|
Beta Was this translation helpful? Give feedback.
-
This proposal looks nice and it would be great to extend it a bit further and allow for a space between the import group.
|
Beta Was this translation helpful? Give feedback.
-
Would be good to extend it even further, by treating alias imported via the 'paths' property as a seperate grouping
|
Beta Was this translation helpful? Give feedback.
-
The next release - out soon - will have this implemented. |
Beta Was this translation helpful? Give feedback.
-
Description
For now, Rome sorts imports regardless if there are relative or absolute / bare specifiers.
In order to have a behavior closer to existent import sorters, such as the one exposed by TypeScript LSP, I propose to place relative imports at the end of an import section.
Currently, the following import section is organized according to Rome:
With this proposal, the imports will be re-organized:
Beta Was this translation helpful? Give feedback.
All reactions