prisma-case-format icon indicating copy to clipboard operation
prisma-case-format copied to clipboard

Run Prisma's `formatSchema` before AND after the case formatting to automatically add missing relations

Open V-ed opened this issue 1 year ago • 2 comments

The Prisma formatter does not only format the schema file, but also does maintenance work on it, such as adding missing relations maps to models that specifies relations.

Currently, if there is a missing relation, this packages formats the fields, tables, etc. as per the configuration, and then formats the file using prisma's formatSchema util, which adds the relations that are not necessarily formatted as per this package's configuration, leading the user to need to run this tool again.

V-ed avatar Feb 20 '24 06:02 V-ed

Hey @V-ed . Maybe I don't follow -- why can't you solve your problem by running prisma format before prisma-case-format?

iiian avatar Feb 20 '24 19:02 iiian

Oh don't get me wrong, this is definitely a way to get around this "issue"!

I love this tool and I'd love for it to completely replace the prisma formatter, and it feels weird to run two things when your formatter already runs prisma format (well, the programmatic function anyway) as part of its execution.

I did make this issue right after #57, you could say they are related in a small way!

V-ed avatar Feb 20 '24 19:02 V-ed