None of these fixes worked for me I found that in my case it was an issue with vscode prettier extension.
Restart the extension fixed it for me.
Ref: https://github.com/prettier/prettier-vscode/issues/3578