@noctcore/eslint-plugin-prisma
A bad fit if you are not multi-tenant, or if tenancy lives in Postgres row-level security rather than a Prisma client extension; most of these rules assume the extension pattern.
Prisma tenancy, data integrity and transaction guardrails around a tenant-scoping client extension.
What it solves
Section titled “What it solves”Multi-tenant Prisma code fails quietly: a query through the unscoped client with no tenant filter, a tenant id taken from the request body, two writes that should be atomic and are not, an audit log written inside a transaction that rolls it back with the work, a soft-deleted row that comes back in a list.
What it will yell at you about
Section titled “What it will yell at you about”It will yell at you about which client you query through and what your where contains. The six preset rules hold with no project knowledge. Four more need your model registry (tenantModels, softDeleteModels, restrictions) and are deliberately left out of the preset, because a rule that reports nothing would read as coverage you do not have. mutation-entry-must-reach-audit needs type information and follows calls across files. It is a bad fit if you are not multi-tenant, or if tenancy lives in Postgres row-level security rather than a Prisma client extension; most of these rules assume the extension pattern.
Install and configure
Section titled “Install and configure”npm install --save-dev @noctcore/eslint-plugin-prisma @typescript-eslint/parser# or: bun add -D / pnpm add -D @noctcore/eslint-plugin-prisma @typescript-eslint/parserThe recommended preset enables 7 of 12 rules. The rules board below builds the flat config: start from a preset, switch single rules between error and off, and copy the result.
Each rule links to its page, with the options it takes and Incorrect and Correct examples. A good first
read is no-unscoped-prisma-outside-allowlist.
--fixsuggestionsneeds optionstype infoEach switch sets a rule to error or off.
$transaction callback, where it rolls back with the business work. It does not check that mutations are audited at all.where or data is read from client input. Without row-level security, a client-supplied tenant id is a cross-tenant access (IDOR).data (or where) is the raw request body. Passing client input straight through lets a caller set any column (mass assignment) or widen the filter.$transaction(async (tx) => ...) callback, writes must go through the tx parameter, not the outer client, so they participate in the transaction and roll back together.$transaction. A partial failure between writes leaves half-written state.where. Soft delete is convention only, with no Prisma extension injecting the filter, so a query that omits it reads and mutates deleted rows.where of a read or bulk write on a tenant-scoped model through the unscoped client, and a scope column in the where of any query on a hand-scoped model.data of a create on a tenant-scoped Prisma model through the unscoped client, which does not inject the tenant scope.