Skip to content
This repository was archived by the owner on Aug 16, 2025. It is now read-only.

prisma lint #263

Merged
merged 2 commits into from
Apr 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
dont show rules direct to docs
  • Loading branch information
alexcoderabbitai committed Apr 2, 2025
commit cf0e65aa1ac624d940e1cd51aa5497ec19fbc6a5
49 changes: 6 additions & 43 deletions docs/tools/prisma-lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ Prisma Lint will run on files with the following extensions:
Prisma Lint supports the following config files:

- `.prismalintrc.json`
- `.prismalintrc`
- `.prismalintrc.js`
- `.prismalintrc.yaml`
- `.prismalintrc.yml`
- `prismalint.config.js`
- User-defined config file set at `reviews.tools.prismalint.config_file` in your project's `.coderabbit.yaml` file or setting the "Review → Tools → Prisma Lint → Config File" field in CodeRabbit's settings page.

:::note
Expand All @@ -33,49 +38,7 @@ By default, Prisma Lint looks for schema files at `prisma/schema.prisma`. If you

## Rule Configuration

Rules can be configured in your `.prismalintrc.json` file. Here's an example configuration:

```json
{
"rules": {
"field-name-mapping-snake-case": [
"error",
{
"compoundWords": ["S3"]
}
],
"model-name-grammatical-number": [
"error",
{
"style": "singular"
}
],
"require-field-index": [
"error",
{
"forAllRelations": true,
"forNames": ["tenantId"]
}
]
}
}
```

## Ignoring Rules

You can ignore rules using three-slash (`///`) comments inside your Prisma models:

```prisma
model User {
/// prisma-lint-ignore-model
// Ignores all lint rules for this model
}

model Post {
/// prisma-lint-ignore-model require-field
// Ignores specific rules for this model
}
```
Rules can be configured in your `.prismalintrc.json` file. See the [Prisma Lint Rules Documentation](https://github.com/loop-payments/prisma-lint/blob/main/RULES.md) for more information on the available rules and their configuration options.

## Links

Expand Down