loop-payments/prisma-lint

Schema path in package.json not respected

espimarisa opened this issue · 3 comments

When Prisma is configured to search for a custom schema path via package.json, prisma-lint does not automatically pick up on it. This means that you have to manually configure prisma-lint to point to the schema, adding a bit more bloat than needed to scripts.

https://www.prisma.io/docs/reference/api-reference/command-reference#schema

To reproduce, simply move the prisma/schema.prisma file elsewhere besides the default path, append the prisma schema option above into package.json, and try to run prisma-lint with no arguments.

prisma-lint will throw a ENOENT error as it can't find the prisma schema at the expected default option. This can be resolved by searching for the option in a package.json file relative to the cwd.

maxh commented

Implementation started here: #135

maxh commented

Ok, I've manually tested and that PR should do it. Under the hood it's using the same library as Prisma to read the package.json. Thanks for the detailed feedback!

maxh commented

Releasing in #136