-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
formatOnSave is not working #290
Comments
same here. |
Can't reproduce (js and ts). Does it work if you call the action ("Format Document") Try reinstalling the extension, it fixed some other issues (don't know why...). |
Same issue here. I worked around it by downgrading to the prior version, 0.2.6. |
@pitkane Do you have a |
@CiGit Oopsie doopsie. Working on two projects at the same time, and the other one had 1.8.2 installed mistakenly. I was quite sure I removed it from both projects... ;) |
@CiGit |
Yes, we don't handle deprecated settings anymore. I would encourage anyone who wishes to use a different version (installed in package.json) to also provide a prettier config file |
Try uninstall/ install the extension and restart vscode (This has fixed issues in the past ...) const x = {
}
const y = {
a: "Hello",
b:'World'
} Lastly, if you could debug it ? I'm unable to reproduce this. |
Reinstalled as you said and it works fine now @CiGit |
Reinstalling resolved it for me as well! Working fine now |
manually running |
I found the issue was caused by different local prettier version. I used perttier@1.8.2 at my project, so the new version of perttier-vscode@1.0.0 can not do @CiGit Thanks. So, if there is some way to use perttier-vscode v1.0.0 with perttier@1.8.2? |
if you have an editorconfig file, that was the problem for us |
@kpman Thanks, life without prettier is such a pain. |
I have this in my
Was working before but now it doesn't format JS files on save anymore |
@pkyeck is that your entire settings.json ? In this case, it seems |
@CiGit no, sorry. thought I copy+pasted the important part. This doesn't work: {
"eslint.enable": true,
"files.exclude": {
"node_modules": true,
".npm-offline-cache": true
},
"editor.formatOnSave": false,
"[javascript]": {
"editor.formatOnSave": true
}
} This works: {
"eslint.enable": true,
"files.exclude": {
"node_modules": true,
".npm-offline-cache": true
},
"editor.formatOnSave": true,
"[javascript]": {
"editor.formatOnSave": true
}
} First version was working before the November update. |
It works on my setup. I suspect you have an issue with something else. maybe your vscode installation. |
mmm, strange. Then I'll have to look into this some more. Thanks for your help, though. |
I've reinstalled everything many times and I can only get 'format selection' to work every time. |
I invite you to read https://code.visualstudio.com/updates/v1_22#_configurable-format-on-save-timeout |
@pkyeck I also had to add
for it to work with .jsx files. Not sure if that was your issue. |
Solution by pkyeck worked great, for typeScript, add in next lines :: |
For TypeScript I needed both to get it working again:
Prettier v1.6.1 |
With Prettier 1.6.1, VSCode 1.27.2, I also had to add
|
Got finally worked for me was to add
I have the following configuration.
|
This: from @dantesolis solved my problem! Thanks |
Non of the solutions here worked for me. I have had the same issue with a bare typescript project. Turns out there was an extra comma in ODD!!!! |
For me, format on save was not working because of |
In my case, as @CiGit mentioned, the format on save was not working because of the timeout. You can check if this is your case reading the output of |
Just so it shows up here explicitly as a comment, VS Code has a timeout for how long format-on-save actions are allowed to take. You can configure this with:
The default is |
@eouw0o83hf 's solution fixed it for me. Turns out it's just my computer being slow at formatting and VSCode automatically times out the formatting action for me. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
After upgrade version to v1.0.0, the vscode setting
formatOnSave
is not working on my machine.But when I change
prettier.eslintIntegration
to true, the auto-format is working.Are there some changes not listed on the Changelog between the version bumping? Or maybe I missed something on the vscode setting?
My Prettier - Code formatter: version
1.0.0
My vscode version:
1.18.1
My vscode setting:
The text was updated successfully, but these errors were encountered: