prisma-lint
Advanced tools
Comparing version 0.4.0 to 0.5.0
import { z } from 'zod'; | ||
import { getRuleIgnoreParams } from '#src/common/ignore.js'; | ||
import { PRISMA_SCALAR_TYPES, getMappedName } from '#src/common/prisma.js'; | ||
@@ -15,2 +16,11 @@ import { toSnakeCase } from '#src/common/snake-case.js'; | ||
* | ||
* This rule support selectively ignoring fields via the | ||
* `prisma-lint-ignore-model` comment, like so: | ||
* | ||
* /// prisma-lint-ignore-model field-name-mapping-snake-case tenantId | ||
* | ||
* That will ignore only `tenantId` field violations for the model. Other | ||
* fields will still be enforced. A comma-separated list of fields can be | ||
* provided to ignore multiple fields. | ||
* | ||
* @example | ||
@@ -101,2 +111,4 @@ * // good | ||
Field: (model, field) => { | ||
if (getRuleIgnoreParams(model, RULE_NAME).includes(field.name)) | ||
return; | ||
const { fieldType } = field; | ||
@@ -103,0 +115,0 @@ if (!isEnumField(context.enumNames, fieldType) && |
{ | ||
"name": "prisma-lint", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "A linter for Prisma schema files.", | ||
@@ -65,3 +65,3 @@ "repository": { | ||
}, | ||
"packageManager": "yarn@4.0.1" | ||
"packageManager": "yarn@4.1.1" | ||
} |
65557
1853