1.0.1 • Published 7 months ago

eslint-plugin-prisma v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

eslint-plugin-prisma

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

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 eslint-plugin-prisma:

npm install eslint-plugin-prisma --save-dev

Usage

Load the recommended configuration:

{
  "extends": ["plugin:eslint-plugin-prisma/recommended"]
}

Add 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": ["prisma"],
  "rules": {
    "prisma/no-unsafe": "error",
    "prisma/require-select": "error"
  }
}

Configurations

Name
āœ…recommended

Rules

šŸ’¼ Configurations enabled in.\ āœ… Set in the recommended configuration.\ šŸ’” Manually fixable by editor suggestions.

NameDescriptionšŸ’¼šŸ’”
no-unsafeDisallow the use of potentially unsafe Prisma methodsāœ…
require-selectForces explicit selection of all fields in Prisma queriesāœ…šŸ’”
1.0.1

7 months ago

1.0.0

7 months ago

0.0.1

1 year ago