Skip to content

Commit 9f05031

Browse files
Prismalint Showcase
1 parent ef04b8d commit 9f05031

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

.prismalintrc.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"rules": {
3+
"field-name-mapping-snake-case": [
4+
"error",
5+
{
6+
"compoundWords": ["S3"]
7+
}
8+
],
9+
"field-order": [
10+
"error",
11+
{
12+
"order": ["tenantId", "..."]
13+
}
14+
],
15+
"forbid-required-ignored-field": ["error"],
16+
"model-name-grammatical-number": [
17+
"error",
18+
{
19+
"style": "singular"
20+
}
21+
],
22+
"model-name-mapping-snake-case": [
23+
"error",
24+
{
25+
"compoundWords": ["GraphQL"]
26+
}
27+
],
28+
"require-field-index": [
29+
"error",
30+
{
31+
"forAllRelations": true,
32+
"forNames": ["tenantId"]
33+
}
34+
]
35+
}
36+
}

example.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
generator client {
2+
provider = "prisma-client-js"
3+
output = "../generated/prisma/client"
4+
}
5+
6+
datasource db {
7+
provider = "postgresql"
8+
url = "fake-url"
9+
}
10+
11+
model Users {
12+
id String @id
13+
emailAddress String
14+
tenantId String
15+
removeMe String @ignore
16+
tenant Tenant @relation(fields: [tenantId], references: [id])
17+
@@map(name: "users")
18+
}
19+
20+
model Tenant {
21+
id String @id
22+
name String
23+
@@map(name: "tenant")
24+
}
25+
26+
model UserRoleFoo {
27+
id String @id
28+
@@map(name: "unexpected_snake_case")
29+
}
30+
31+
model UserRole {
32+
id String @id
33+
userId String @map(name: "userid")
34+
// No mapping.
35+
}

0 commit comments

Comments
 (0)