The extension already sets the formatter for prisma files, but with the prettier extension installed as well, this sets the default formatter for all files, overwriting all other formatters unfortunately.
Workaround is mentioned here: prisma/prisma#1761 (comment)
Open VS Code Settings and set:
{
"editor.formatOnSave": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
Alternative solution by @LeonardSSH
{
"editor.formatOnSave": true,
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
},
}
AC:
- There is a section in the README that informs users about Prisma & Prettier incompatibility and workaround.
The extension already sets the formatter for prisma files, but with the prettier extension installed as well, this sets the default formatter for all files, overwriting all other formatters unfortunately.
Workaround is mentioned here: prisma/prisma#1761 (comment)
Open VS Code Settings and set:
{ "editor.formatOnSave": true, "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[typescriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" } }Alternative solution by @LeonardSSH
{ "editor.formatOnSave": true, "[prisma]": { "editor.defaultFormatter": "Prisma.prisma" }, }AC: