Format *.tsx files on save in VS Code
"[typescriptreact]": {
"editor.formatOnSave": true
}
See also Language specific editor settings
Alternative way with using a plugin like 'ESLint':
"[typescriptreact]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
You can install Prettier Code formatter extension and add these two options in your settings.json file
{
"typescript.format.enable": false,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}