How to fix Vscode auto-formatting when saving a . js
Asked
Viewed 46 times
0
In this example code . js, whenever saved, automatically, the formatting is different than expected and as a consequence generates error. See this code:
I already went to SETTINGS -> format on save and disabled. It didn’t work. Who already solved this problem?
Cara never had this problem, but I recommend using the extension Prettier - Code Formatter, it serves to format your code. then just put it as default formatting and ready. You can add this code in the Settings: "[javascript]": {"editor.defaultFormatter": "esbenp.prettier-vscode"}, I hope you helped, to access the Settings easily, just press F1 inside the VSCODE, type Settings, should appear "Preferences: Open Settings (JSON)", then you select and add the code there.
Cara never had this problem, but I recommend using the extension Prettier - Code Formatter, it serves to format your code. then just put it as default formatting and ready. You can add this code in the Settings: "[javascript]": {"editor.defaultFormatter": "esbenp.prettier-vscode"}, I hope you helped, to access the Settings easily, just press F1 inside the VSCODE, type Settings, should appear "Preferences: Open Settings (JSON)", then you select and add the code there.
– Lucas pereira