npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@v2nic/eslint-plugin-prisma

v1.2.6

Published

ESLint plugin ensuring best practices and code quality for Prisma with TypeScript

Readme

eslint-plugin-prisma

ESLint plugin ensuring best practices and code quality for Prisma with TypeScript

npm version

Overview

This ESLint plugin is designed to help developers maintain best practices and enforce code quality when using Prisma in TypeScript projects. It includes a set of custom rules tailored to the specific requirements and idioms of Prisma, aiming to prevent common pitfalls and encourage efficient, clean, and secure database interactions.

Installation

You'll first need to install ESLint:

npm install eslint --save-dev

Next, install @v2nic/eslint-plugin-prisma:

npm install @v2nic/eslint-plugin-prisma --save-dev

Using the plugin from source

If you want to use a local checkout instead of the registry, build the package and install it via a file path.

npm install
npm run build

From the consuming project:

npm install /absolute/path/to/eslint-plugin-prisma --save-dev

If you update the plugin source, re-run npm run build in the plugin repo and reinstall. For local development, you can use npm link to create a global symlink to the package and then link it into your consuming project:

# in the plugin repo
npm link

# in the consuming repo
npm link @v2nic/eslint-plugin-prisma

This makes Node resolve the plugin to your local checkout. The global link lives under your npm prefix (from npm prefix -g) at lib/node_modules/@v2nic/eslint-plugin-prisma (macOS/Linux) or node_modules\@v2nic\eslint-plugin-prisma (Windows). You still need to rebuild after changes (npm run build) because consumers load the compiled output. To stop using the linked package, run npm unlink --no-save @v2nic/eslint-plugin-prisma in the consuming repo and npm unlink in the plugin repo.

Usage

Example failure for schema field naming:

model InvoiceItem {
  id Int @id
  customer_id String
}
schema.prisma
  3:3  error  Schema field names must follow the camelCase style  prisma/schema-field-name-style

VS Code ESLint validation

The VS Code ESLint extension only validates language IDs listed in eslint.validate. ESLint config does not control this. Add Prisma to your workspace or user settings to enable linting in .prisma files:

{
  "eslint.validate": ["javascript", "typescript", "prisma"]
}

ESLint flat config

Use the processor object and plugin map. This complete example shows both overrides:

import prisma from '@v2nic/eslint-plugin-prisma';

export default [
  {
    files: ['**/*.prisma'],
    plugins: { prisma },
    processor: prisma.processors['.prisma'],
  },
  {
    files: ['**/*.prisma.js'],
    plugins: { prisma },
    rules: {
      'prisma/schema-field-name-style': 'error',
      'prisma/schema-model-name-style': 'error',
      'prisma/schema-enum-name-style': 'error',
      'prisma/schema-enum-value-style': 'error',
      'prisma/db-table-name-style': 'error',
      'prisma/db-column-name-style': 'error',
      'prisma/db-enum-name-style': 'error',
      'prisma/db-enum-value-style': 'error',
    },
  },
];

The processor rewrites schema.prisma into schema.prisma.js, so rule overrides must target **/*.prisma.js for flat config. An override is the file-matching block in your config array that applies rules to a specific glob. The **/*.prisma override only enables the processor. If you prefer, prisma.configs['prisma-schema-flat'] provides the processor-only override.

Rule selection

You must specify the rules you want to enable. If you want the naming rules with defaults, use the bundled preset:

import prisma from '@v2nic/eslint-plugin-prisma';

export default [...prisma.configs['prisma-schema-flat-recommended']];

Classic config (.eslintrc)

To lint Prisma schema files, enable the processor configuration and set rules in an override:

{
  "extends": ["plugin:@v2nic/prisma/prisma-schema"],
  "overrides": [
    {
      "files": ["*.prisma.js"],
      "rules": {
        "prisma/schema-field-name-style": "error",
        "prisma/schema-model-name-style": "error",
        "prisma/schema-enum-name-style": "error",
        "prisma/schema-enum-value-style": "error",
        "prisma/db-table-name-style": "error",
        "prisma/db-column-name-style": "error",
        "prisma/db-enum-name-style": "error",
        "prisma/db-enum-value-style": "error"
      }
    }
  ]
}

For classic config, you can also use the bundled prisma-schema-recommended config for default naming rules on the processed *.prisma.js file.

Add @v2nic/prisma to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix. Then configure the rules you want to use under the rules section:

{
  "plugins": ["@v2nic/prisma"],
  "rules": {
    "prisma/no-unsafe": "error",
    "prisma/require-select": "error"
  }
}

Load the recommended configuration:

{
  "extends": ["plugin:@v2nic/prisma/recommended"]
}

Rule names are always under the prisma/* namespace even when the plugin is scoped.

Configurations

The table below is generated from the exported configs. The ✅ marker indicates the recommended preset, which enables no-unsafe and require-select only.

| | Name | | :-- | :------------------------------- | | | prisma-schema | | | prisma-schema-flat | | | prisma-schema-flat-recommended | | | prisma-schema-recommended | | ✅ | recommended |

Rules

The rules table is generated from each rule definition. The 💡 marker means the rule provides ESLint suggestions via meta.hasSuggestions.

💡 Manually fixable by editor suggestions.

| Name                    | Description | 💡 | | :--------------------------------------------------------------- | :------------------------------------------------------------------- | :-- | | db-column-name-style | Enforce database column names to follow the configured style | 💡 | | db-enum-name-style | Enforce database enum names to follow the configured style | 💡 | | db-enum-value-style | Enforce database enum values to follow the configured style | 💡 | | db-table-name-style | Enforce database table names to follow the configured style | 💡 | | no-snake-case-in-ts | Disallow snake_case identifiers and keys in TypeScript | 💡 | | no-unsafe | Disallow the use of potentially unsafe Prisma methods | | | require-select | Forces explicit selection of all fields in Prisma queries | 💡 | | schema-enum-name-style | Enforce schema enum names to follow the configured TypeScript style | 💡 | | schema-enum-value-style | Enforce schema enum values to follow the configured TypeScript style | 💡 | | schema-field-name-style | Enforce schema field names to follow the configured TypeScript style | 💡 | | schema-model-name-style | Enforce schema model names to follow the configured TypeScript style | 💡 |