-
-
Notifications
You must be signed in to change notification settings - Fork 524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Imports are not sorted #3882
Comments
This is by design. Import sorting is meant to work very much like formatting: you configure your IDE/editor to run it on save, and then you can use the CLI to enforce it wherever you want |
Thank you! While it doesn't work as documented, it works as follows (i.e. without "editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
} |
I'm still not able to get this working on 1.9.0 or any of the 1.8.4 nightlys. The imports will sort with the CLI, but not the extension. Can someone send me their VSCode configuration to allow this? |
After upgrading to 1.9.0
works for me.
does not. my full codeActionsOnSave now is set to:
as a workaround |
This is a regression. It should work with the |
correction - this isn't actually working. It's using the editor's default sort order when I do that. |
Right, this is supplied by the Typescript language server. Biome's import sorting is different from Typescript's (for whatever reason), so while this will sort your imports in some way, |
I am sure the cause of the regression is #3731 |
I use the 1.9 version. |
We did, still formatting via the extension fails while formatting in the cli work |
Duplicate of #3879 It will be fixed in the next patch |
@ematipico So is there no way to automate it? |
@ck-euan You'd run |
@jackTabsCode For me imports never sort with the CLI I just get the error "Import statements could be sorted" |
You need to use |
VS Code version
1.92.2
Extension version
2.3.0
Biome version
1.8.3
Operating system
Description
Formatting (on save, or manually) doesn't sort imports.
The extension also doesn't indicate any warning or error regarding import order.
However,
biome check
reports errors:Steps to reproduce
Write a TypeScript file with wrongly sorted imports.
Expected behavior
The extension should show a warning or error when the imports are not sorted as expected, and should offer a quickfix.
When formatting the document (manually or on save), the imports should be sorted.
Does this issue occur when using the CLI directly?
No
Link to a minimal reproduction
No response
Logs
No response
The text was updated successfully, but these errors were encountered: