I am working on a React project using a Visual Studio Code. When I press Ctrl+S in the Visual Studio Code to save file, it removes all the JavaScript formatting or scatters all the code in the file.
Any help would be appreciated.
I am working on a React project using a Visual Studio Code. When I press Ctrl+S in the Visual Studio Code to save file, it removes all the JavaScript formatting or scatters all the code in the file.
Any help would be appreciated.
You disable it "Format On Save"

To expand on Tuxedo Joe's answer, your issue might be with your formatter extension:
Check if "Format On Save" is disabled
Disable formatting on save in formatter.json:
formatter.json set "onSave" to falseformatter.jsonselect language mode by clicking on your bottom right hand from javascript/html to react
First of all, check whether 'Format on Safe' is enabled or not.
If you've got it disabled, check the format text. It's probably that you've got javascript or html format. Change it to 'react' or 'javascript react' format.
In my case it was due to enabled Default HTML formatter:
Push Ctrl + >, then Extentions > HTML: