-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
"No formatter for 'vue'-files installed" #592
Comments
This has been reported before (#543 ) but I haven't been able to track it down. Can you first try to run it with https://github.com/octref/veturpack and see if it still happens? Also, can you provide a list of all extensions you have? |
I tried testing out veturpack, it didn't pass the trials in the readme:
The extensions I have installed:
|
I still can't reproduce it...If you do Help -> Toggle Developer Tools in VS Code, does it show any interesting errors? |
That's because you do need this config for it to work. https://vuejs.github.io/vetur/linting-error.html
That's probably because Vue Language Server isn't started properly. |
I reinstalled vscode and added just vetur plugin, it worked after that. I suppose it was conflicting with some other package? The issues I mentioned are resolved after the new install - although the .eslintrc.js file is not being used for the javascript formatting (standard); I have |
You need to use eslint-plugin-vue, not eslint-plugin-html, which does not work with prettier-eslint. Look at the setup in Veturpack: https://github.com/octref/veturpack |
Hi @octref, so removing |
@eric-burel Yes, you should use the vue plugin which is official. The webpack template has been outdated. They are working on a major bump for vue-cli 3.0, so they might be rewriting a lot of the templates. |
I have a different and similar problem: I'm on mac OS Sierra This is my VSC settings:
Installed extensions list:
Should I clear something somehow? |
I am having this problem that VSCode won't format. I get this error in the developer tools when the window loads:
|
Hi @octref, it does not seem related to switching to |
I spent a lot of time trying to get this to work for my project and I thought I'd share what I found out. I'm not sure if all these steps are necessary, but this is what I ended up with through trial and error. My initial eslintrc.js file was this:
First thing I had to do was move my Then I had to switch to using the vue plugin and add Once I did that I had to fix the issue with parser: 'babel-eslint'. However, I found changing their parse options to what was recommended didn't work either (possibly because my node-modules folder with babel-eslint was still in the sub-directory) so I removed it altogether. I had similar issues with the standard module so I removed that as well and just pasted the rules for it below (found here) Here is the final configuration of my file that I put in the root folder of the project:
I'm hoping someone can help me figure out how to get the modules/importing working and how to get it working with the file in the subdirectory. Also, one other caveat, the formatting breaks with any file that has async/await in it (this might be because I'm not using the babel-eslint module anymore). There might be issues with other es6 syntax I'm not aware of too. Edit: |
This is due to some update in one of the related extensions. It was working fine for me at some point (last December?) and now it's not. Seems to be related to prettier+eslint, because prettier+tslint works great. |
where is the correct answer, annoyed~ |
Adding this to vscode settings has fixed it for me:
|
I think we're talking about Prettier formatting JS code within |
I have this setitngs now and it works well:
|
That's an invalid setting. It can either be |
There must've been an update. Suddenly today, Vetur is able to use prettier to clean up my script blocks! |
@ffxsam Did you update VSCode ? Because this all started with a VSCode update. I still can reproduce and that in both a Vue and a Nuxt project. |
@eric-burel That's possible.. I don't remember. I just sorta update when it prompts me and go on with my day. 😄 I'm on 1.19.3. |
After an OS reinstall, I'm now getting "Sorry, but there is no formatter for 'vue'-files installed." And on top of that, the 'scaffold' snippet is missing. EDIT: Uninstalled Vetur, quit VS Code, ran Code, installed Vetur, quit, re-opened. Works now. I think Vetur didn't like being auto installed by the Sync Settings extension. |
Had exactly same issue (OS reinstall w10), as well used Sync Settings for vscode, but then re-install of vetur helped to solve it. |
no, I just reinstalled OS (yep, that means reinstallation of operating system, windows 10 in my case), then installed vscode and then did a sync of extensions using a "Sync Settings" extensions, and having installed vetur and js-beautify this way I was facing this issue of "Sorry, but there is no formatter for 'vue'-files installed." But then, after I uninstalled vetur and then restarted vscode and installed vetur (as suggested here) everything worked again, so it's like the Sync Settings extension doesn't install vetur properly or something (like colleague suggested) I'm on 64bit version of vscode |
@kaluznyt use your method, but the problem is still ... |
Do you have Beautify installed ? If yes, do you have this in your settings ? if yes, I don't have any other idea why this is not working for you sorry. |
I have same issue |
@goors That runs the selection formatter, whereas Vetur only has a whole document formatter. |
I opened microsoft/vscode#45605 |
@octref any chance |
@evenfrost It'll never be supported. Just imagine you select some random html and css from a vue file and expect it to be formatted. What's the correct format? What's the correct indentation? What if you have regions spanning through |
@octref I don't really know VS Code API that much but I see that Again, I have little to no experience with writing plugins for VS Code, and you do undoubtedly know better, I just thought it could be handy addition as there are situations where we need to format only single selection and full document format is undesirable (may break other things). |
Got it, thanks for getting in touch and all the hard work on Vetur. |
@octref Thank you, had this issue too and for me it was definitely that format selection ctr k ctr f does NOT work, format document works fine... nice work. In my case, I was able to uninstall beautify, uninstall Eslint (the plugin, I might have it global....), still works great. |
Same here, I use to launch the Format Selection ((ctrl+K)+(ctrl+F)) instead of Format Document with ctrl+shitf+I. |
Doc has been updated. |
Great, thank you @octref . |
So what's the method to fix this atm? Link to the docs? |
Summary:
|
These Vetur settings fixes my issue "vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatter.js": "prettier",
"vetur.format.defaultFormatter.scss": "prettier",
"vetur.format.defaultFormatter.stylus": "stylus-supremacy",
"vetur.format.defaultFormatter.ts": "vscode-typescript",
|
I have been using the |
https://vuejs.github.io/vetur/formatting.html#js-beautify-html-deprecated
prettyhtml -> #912 |
Can you please explain how can I use prettyhtml? Please provide the steps I'm sure it'll help others too |
The PR is not merged yet. |
Ok. When it is merged, please do let us know how to use it here. BTW any ETA? |
I receive many notifications per day and I'm not there to keep everyone posted. You can subscribe to the PR. |
Instead of Format Document, I can use 'Beutify Vue' command. |
I went through EVERY SINGLE things here and finally ffxsam's solution worked for me: Uninstalled Vetur, quit VS Code, ran VS Code, installed Vetur, quit, re-opened. Works now. I think Vetur didn't like being auto installed by the Sync Settings extension. |
I get a similar error with |
Info
Problem
I can't format .vue files, it keeps saying there is no formatter for 'vue'-files installed:
I've installed prettier extension and added .prettierrc, what am I missing?
The text was updated successfully, but these errors were encountered: