Closed daeteck closed 2 months ago
Interesting. We don't use DB enums so haven't run into this. I'll try to take a look this weekend.
We need to update this function: https://github.com/loop-payments/prisma-lint/blob/4da8cb674be2a87080ba684bf8cbd3a092473a54/src/rules/field-name-mapping-snake-case.ts#L135-L143
https://github.com/loop-payments/prisma-lint/pull/365 is code complete
@daeteck please try 0.4.0
@maxh it works perfect! Thanks a lot for this fix and sorry for my late response.
When the field is a custom type in MongoDB or the field is a enum in for example Postgres the rule field-name-mapping-snake-case do not thrown any warning / error.
Example for enum (Postgres):
In the example above, the field
saleChannel
should be mapped to@map("sale_channel")
when the field-name-mapping-snake-case it's on, but the lint do not throws a warning or an error.Example for custom types (MongoDB):
In the example above, the field
LocationAdditionalInformation
should be mapped to@map("additional_information")
when the field-name-mapping-snake-case it's on, but the lint do not throws a warning or an error.