intellij-prisma
intellij-prisma copied to clipboard
add prettier reformat?
Hello and thank you for this plugin!
Is there a way to reformat in a similar way that you can in VSCode? I think this is something done via prettier but I'm not really sure.
https://github.com/prisma/prisma/issues/1761
Hello! There is a prisma format command that does exactly that. I will take a look at how to integrate this in the plugin but in the meantime, you should be able to add a custom file watcher directly in webstorm.
if I do format code -- it will autoformat .prisma files for me
example if I have:
model Expense {
id String @id @default(auto()) @map("_id") @db.ObjectId
title String
amount Float
date DateTime
dateAdded DateTime @default(now())
}
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
email String
password String
expenses Expense[]
}
it will autoformat that to:
model Expense {
id String @id @default(auto()) @map("_id") @db.ObjectId
title String
amount Float
date DateTime
dateAdded DateTime @default(now())
User User? @relation(fields: [userId], references: [id])
userId String? @db.ObjectId
}
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
email String
password String
expenses Expense[]
}