eslint-plugin-prisma
v0.0.1
Published
ESLint plugin ensuring best practices and code quality for Prisma with TypeScript
Downloads
942
Maintainers
Readme
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/explicit-field-selection": "error"
}
}
Configurations
| | Name |
| :- | :------------ |
| ✅ | recommended
|
Rules
💼 Configurations enabled in.
✅ Set in the recommended
configuration.
💡 Manually fixable by editor suggestions.
| Name | Description | 💼 | 💡 | | :--------------------------------------------- | :-------------------------------------------------------- | :- | :- | | no-unsafe | Disallow the use of potentially unsafe Prisma methods | ✅ | | | require-select | Forces explicit selection of all fields in Prisma queries | ✅ | 💡 |