question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

formatOnSave not firing

See original GitHub issue

Like #440, #441, and others, I too am having issues with Prettier after the 1.23.0 update, but slightly different. If I use the > Format Document from the command panel dropdown, it works, but it doesn’t format on save anymore.

I have looked through the different logs in Output tab, but don’t see anything that seems to be an error.

In my vscode settings I have only these settings with nothing else

{
    "editor.formatOnSave": false,
    "[javascript]": {
        "editor.formatOnSave": true
    }
}
As (mostly) seen in this screen shot, I have all my extensions, except this one, disabled.

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

37reactions
kyledetellacommented, Sep 7, 2018

I was having a similar problem with .tsx files. @kyleknighted’s fix worked for me (with a slight tweak):

"[typescriptreact]": {
  "editor.formatOnSave": true
},
9reactions
kyleknightedcommented, May 16, 2018

Looks like adding

"[javascriptreact]": {
    "editor.formatOnSave": true
},

appears to fix the issue. I didn’t realize VSCode differentiated between the two. I’ve got my plugins enabled and everything appears to be working again. I’m curious as to how it worked before without this specific language, but I guess as long as it works now… 😃

Thanks for helping me debug. Closing the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Format on Save (prettier) stopped working with latest update
formatOnSave , the problem is prettier stopped working, even manual formatting (SHIFT + ALT + F) wasn't working, and it worked again after ......
Read more >
VS-Code Prettier Format On Save doesn't work - Stack Overflow
First check if Prettier works fine. You can try to format a single file using Shift + Cmd + P and Format Document...
Read more >
How to use Prettier in VS Code - Robin Wieruch
A brief step by step tutorial on how to install and use Prettier in VS Code (Visual Studio Code). Prettier is an opinionated...
Read more >
I finally learned how to setup Prettier & VSCode - YouTube
Prettier & VSCode not working is a common problem. ... extension 00:35 Enable Format on Save 01:07 Set default formatter 02:02 Test it...
Read more >
How to enable auto format on save with prettier in VS Code ...
Explainer video about How to enable auto format on save in VS Code (Visual Studio Code) editor with prettier code formatter extension on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found