I have my editor set to fix all issues upon saving. However, once I saved, it formats the code to fix the issues, then a split second later reverts back to the original unfixed and unformatted code. This started happening after I updated vscode.
Asked
Active
Viewed 1,521 times
3 Answers
9
Not saying this will be your case, but worth checking:
- Make sure this setting is false:
"editor.formatOnSave": false
- Add this to the
settings.json
file :
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
If you don't use ESLint / Prettier installed, then do the opposite, meaning just make sure that formatOnSave
is set to true and you don't have other formatters enabled.

Jonathan Perry
- 2,953
- 2
- 44
- 51
2
I had the same problem and it really killed me as I uninstalled prettier and eslint, reset the rules and everything...
Until I saw I had that lonefy.vscode-js-css-html-formatter
package, which is silent in the settings but still forces its own opinionated formatting rules. Uninstalling it made the trick :)

Francois
- 21
- 2
-
I had this issue with stylelint, uninstalling lonefy instantly fixed the problem. – Pavlo Apr 18 '22 at 15:30
0
I solved my issue by following the steps outlined in this answer https://stackoverflow.com/a/52259752/9491881
Short answer: I needed:
"editor.formatOnSave": false,
"javascript.format.enable": false