-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Unable to auto-format imports in Vue SFCs #106
Comments
Probably due to the newer versions of the Volar/Vue tooling. See #98. |
I got the same problem now. Weirdly enough it seemed to be working for a while. @simonhaenisch do you plan to fix this? Edit: Managed to get it working for now by explicitly adding |
Regarding the original issue: IIRC there was a breaking change in one of the later minor versions of
This requirement is documented in the readme: prettier-plugin-organize-imports/readme.md Lines 73 to 75 in 16df387
|
Ah, sorry about that. I probably read that in the readme when I originally installed the plugin, forgot about it and then later removed the volar package because of the renaming 😅 |
Description
I'm running into issues getting the imports automatically sort in Vue SFCs.
As the docs suggestion, I've installed
@volar/vue-typescript
(and have also tried@vue/typescript
)—but that didn't resolve the issue.I've attempted to get the auto-sorting working in both an existing project, and a completely fresh Vue project (see steps to reproduce below).
Maybe I'm missing an obvious config option?
Note 📝: I am able to auto-sort the imports when using this native VSCode option:
Steps to reproduce
npm init vue@latest
npm install
npm install --save-dev prettier-plugin-organize-imports
.prettierrc.json
to look like this:Results
Non-Vue (
.ts
,.js
, etc.) files are correctly having their imports auto-formatted. However, the imports in.vue
files aren't auto-formatting.The text was updated successfully, but these errors were encountered: