loop-payments / prisma-lint

A linter for Prisma schema files.
https://www.npmjs.com/package/prisma-lint
MIT License
128 stars 6 forks source link

Support exceptions for the `Expected singular model name. model-name-grammatical-number` error #354

Closed kibertoad closed 6 months ago

kibertoad commented 6 months ago

Similarly to how model-name-mapping-snake-case has a list of compound words, model-name-grammatical-number should support a list of exceptions too. E. g. settings or scissors are singular, it makes no sense to create a table setting or scissor.

maxh commented 6 months ago

Makes sense. Internally we simply disable the rule with in-line comments on such models, but adding this to the config is a good idea.

maxh commented 6 months ago

Example:

model ArtifactMetadata {
  /// prisma-lint-ignore-model model-name-grammatical-number
}
kibertoad commented 6 months ago

Yeah, that's what we did as a short-term solution, but having proper config would be nice :D

maxh commented 6 months ago

Does this support your use case? https://github.com/loop-payments/prisma-lint/pull/356

kibertoad commented 6 months ago

This is perfect, thanks!