eslint-plugin-prisma v1.0.1
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-devNext, install eslint-plugin-prisma:
npm install eslint-plugin-prisma --save-devUsage
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.
| Name | Description | š¼ | š” |
|---|---|---|---|
| no-unsafe | Disallow the use of potentially unsafe Prisma methods | ā | |
| require-select | Forces explicit selection of all fields in Prisma queries | ā | š” |