From 6a615ba896708a613134a3c5c39a485d4c219c5d Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 2 Apr 2025 11:56:57 -0400 Subject: [PATCH] add prisma --- .prismalintrc.json | 36 ++++++++++++++++++++++++++++++++++++ example.prisma | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 .prismalintrc.json create mode 100644 example.prisma diff --git a/.prismalintrc.json b/.prismalintrc.json new file mode 100644 index 0000000..274277e --- /dev/null +++ b/.prismalintrc.json @@ -0,0 +1,36 @@ +{ + "rules": { + "field-name-mapping-snake-case": [ + "error", + { + "compoundWords": ["S3"] + } + ], + "field-order": [ + "error", + { + "order": ["tenantId", "..."] + } + ], + "forbid-required-ignored-field": ["error"], + "model-name-grammatical-number": [ + "error", + { + "style": "singular" + } + ], + "model-name-mapping-snake-case": [ + "error", + { + "compoundWords": ["GraphQL"] + } + ], + "require-field-index": [ + "error", + { + "forAllRelations": true, + "forNames": ["tenantId"] + } + ] + } +} \ No newline at end of file diff --git a/example.prisma b/example.prisma new file mode 100644 index 0000000..d9c084b --- /dev/null +++ b/example.prisma @@ -0,0 +1,35 @@ +generator client { + provider = "prisma-client-js" + output = "../generated/prisma/client" +} + +datasource db { + provider = "postgresql" + url = "fake-url" +} + +model Users { + id String @id + emailAddress String + tenantId String + removeMe String @ignore + tenant Tenant @relation(fields: [tenantId], references: [id]) + @@map(name: "users") +} + +model Tenant { + id String @id + name String + @@map(name: "tenant") +} + +model UserRoleFoo { + id String @id + @@map(name: "unexpected_snake_case") +} + +model UserRole { + id String @id + userId String @map(name: "userid") + // No mapping. +} \ No newline at end of file