{"id":26107,"library":"prisma-lint","title":"prisma-lint","description":"A linter for Prisma schema files, currently at v0.13.1. It provides a configurable set of rules (e.g., naming conventions, field order, index requirements) similar to ESLint, all disabled by default. Supports Prisma 7+ config files (prisma.config.ts) and legacy package.json schema path. Uses ignore comments (/// prisma-lint-ignore-model, /// prisma-lint-ignore-field) and multiple output formats (simple, contextual). Released frequently with new rules and fixes. Differentiates from other Prisma tools by focusing purely on linting schema files, not migrations or querying.","status":"active","version":"0.13.1","language":"javascript","source_language":"en","source_url":"https://github.com/loop-payments/prisma-lint","tags":["javascript"],"install":[{"cmd":"npm install prisma-lint","lang":"bash","label":"npm"},{"cmd":"yarn add prisma-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add prisma-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Loads configuration files (e.g., .prismalintrc.json, YAML, JS).","package":"cosmiconfig","optional":false},{"reason":"Uses Prisma's internal schema parser to analyze the AST.","package":"prisma","optional":false}],"imports":[{"note":"The package is primarily used as a CLI tool (npx prisma-lint), but the programmatic API is available via ESM default export.","wrong":"const prismaLint = require('prisma-lint')","symbol":"default","correct":"import prismaLint from 'prisma-lint'"},{"note":"Named export for programmatic linting. Available since v0.10.0. For older versions, use default export.","wrong":"const { lint } = require('prisma-lint')","symbol":"lint","correct":"import { lint } from 'prisma-lint'"},{"note":"TypeScript users should use `import type` for type-only imports to avoid runtime errors.","wrong":"import { LoadConfigOptions } from 'prisma-lint'","symbol":"LoadConfigOptions","correct":"import type { LoadConfigOptions } from 'prisma-lint'"}],"quickstart":{"code":"import { lint } from 'prisma-lint';\n\nasync function main() {\n  const results = await lint({\n    schemaPath: 'prisma/schema.prisma',\n    config: {\n      rules: {\n        'model-name-camel-case': 'error',\n        'field-name-camel-case': ['error', { allowUnderscore: false }],\n      },\n    },\n  });\n  console.log(JSON.stringify(results, null, 2));\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Programmatic usage: lint a Prisma schema with custom rules and output results as JSON."},"warnings":[{"fix":"If you use Prisma 7+, migrate your schema path to prisma.config.ts. If you rely on package.json#prisma.schema, ensure no conflicting Prisma 7 config exists.","message":"Schema path resolution changed in v0.13.0. Prisma 7+ config files (prisma.config.ts or .config/prisma.ts) are now preferred over package.json#prisma.schema.","severity":"breaking","affected_versions":">=0.13.0"},{"fix":"Replace `enum-value-snake-case` with `enum-value-case` and configure `case: 'lower'` (or adjust as needed).","message":"Rule `enum-value-snake-case` is deprecated in v0.11.0 in favor of `enum-value-case`.","severity":"deprecated","affected_versions":">=0.11.0"},{"fix":"Create a .prismalintrc.json file with a \"rules\" object listing the rules you want to enable and their severity.","message":"All rules are disabled by default. You must create a configuration file (e.g., .prismalintrc.json) to enable rules.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use /// prisma-lint-ignore-model or /// prisma-lint-ignore-field with exactly three slashes.","message":"Ignore comments require exactly three slashes (///). Two slashes (//) or four slashes (////) are ignored.","severity":"gotcha","affected_versions":">=0.9.0"},{"fix":"Ensure compound words match the exact casing used in your schema (e.g., 'S3' not 's3').","message":"The `compoundWords` option in snake-case rules is case-sensitive. Wrong case causes false positives.","severity":"gotcha","affected_versions":">=0.10.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install as dev dependency: npm install --save-dev prisma-lint","cause":"prisma-lint not installed or installed globally instead of locally.","error":"Error: Cannot find module 'prisma-lint'"},{"fix":"Create a configuration file (e.g., .prismalintrc.json) with a \"rules\" field.","cause":"Missing .prismalintrc.json or similar config file.","error":"Error: No configuration found for prisma-lint"},{"fix":"Check the RULES.md file for valid rule names. Common rules: 'model-name-camel-case', 'field-name-camel-case'.","cause":"Rule name is misspelled or does not exist.","error":"Error: Unknown rule 'model-name-camel-case'"},{"fix":"Verify the schema path. Provide explicit path via CLI argument or configure in prisma.config.ts / package.json#prisma.schema.","cause":"Schema file does not exist or path is incorrect.","error":"Error: Failed to load schema from 'prisma/schema.prisma'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}