-
Notifications
You must be signed in to change notification settings - Fork 21
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
Sorting breaks typescript comments #57
Comments
This is unexpected, the last known behaviour is that the tool assumes a comment above an import is part of the import itself. More info at #20 I cannot reproduce it, I pasted your code in a new file and sorting the imports moves the comment with the import, not below. Can you disable all other extensions and try again? |
I've re-tested it.. Using a new Virtual Machine, a new install of the latest VSCode, and only the 'vsc-sort-imports' plugin installed. All options were left as default. issue still occurs: See image: |
does the same thing happen if you install import-sort-cli (v6) directly and run it against the file? |
Indeed, the same thing happens when just running the CLI |
If the CLI does it too then it's not an issue of this extension but of the core |
Yes, I can reproduce it by changing my line endings from LF to CRLF. This issue can be fixed by changing the file line endings to LF. That said, this should work with any line endings and we should notify renke/import-sort and try to help them fix it. |
I never thought about the line endings. Glad we got to the bottom of it.. And I can see you've commented on the open issue you found. Hopefully they can get it fixed soon :) |
When given the following import:
the plugin auto-sorts and removes comments, so it looks like this:
This will break the the server import though, as there are no typescript definitions for it
The text was updated successfully, but these errors were encountered: