As you note, the Beautify extension is the root cause here (see this issue). That extension provides a document formatter that VSCode will run when you run the format command
A few options:
- Disable the extension
- Disable Beautify for just js files by removing the
jsentry from the"beautify.language"setting - Make sure your file has a language mode of
javascriptreact. I believe this will prevent Beautify from running on the file