Registry / database / eslint-plugin-drizzle

eslint-plugin-drizzle

JSON →
library0.2.3jsnpmunverified

An ESLint plugin for Drizzle ORM users to avoid common pitfalls and enforce best practices. Version 0.2.3 (stable). Maintained by the Drizzle team. Provides rules like `enforce-update-with-where` to prevent accidental full table updates/deletes, and `drizzle-object-injection` to detect SQL injection via object keys in Drizzle queries. Works with ESLint 8+. Released as needed with fixes and rule additions.

npm install eslint-plugin-drizzle
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-DRIZ
E
eslint-plugin-drizzle
databasejavascriptv0.2.3
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
✓ import drizzlePlugin from 'eslint-plugin-drizzle'
✗ const drizzlePlugin = require('eslint-plugin-drizzle')
ESM-only; no CommonJS export. Use dynamic import if needed.
rules
✓ import { rules } from 'eslint-plugin-drizzle'
✗ import rules from 'eslint-plugin-drizzle/rules'
Named export for rules object; direct subpath import not supported.
enforceUpdateDeleteWithWhere
✓ import { enforceUpdateDeleteWithWhere } from 'eslint-plugin-drizzle'
✗ import { enforceUpdateDeleteWithWhereRule } from 'eslint-plugin-drizzle'
Rule name in camelCase exported directly; no 'Rule' suffix.
drizzleObjectInjection
✓ import { drizzleObjectInjection } from 'eslint-plugin-drizzle'
✗ import { drizzleObjectInjectionRule } from 'eslint-plugin-drizzle'
Exported as camelCase without 'Rule' suffix.

Configures ESLint to use eslint-plugin-drizzle rules, enforcing safe update/delete patterns and preventing SQL injection via object keys.

// .eslintrc.js export default { plugins: { drizzle: await import('eslint-plugin-drizzle') }, rules: { 'drizzle/enforce-update-with-where': 'error', 'drizzle/drizzle-object-injection': 'error', 'drizzle/invalid-auth-token': 'warn' } };
Debug
Known issues
gotchaESM-only: package does not provide CommonJS export.
fix
Use dynamic import or ensure ESLint is configured for ESM.
affects: >=0.1.0
gotchaRule names are camelCase but ESLint convention uses kebab-case when referencing in config.
fix
Use kebab-case in rules object (e.g., 'drizzle/enforce-update-with-where').
affects: >=0.0.0
gotchaPlugin requires ESLint >=8.0.0.
fix
Upgrade ESLint to version 8 or later.
affects: >=0.0.0
breakingIn v0.2.0, rule 'drizzle-object-injection' was added; prior versions may not have it.
fix
Update to v0.2.0+ to use the rule.
affects: <0.2.0
Errors
Common errors & fixes
Error: Failed to load plugin 'drizzle' declared in '.eslintrc.js': Cannot find module 'eslint-plugin-drizzle'
Plugin not installed or CommonJS require used.
fix
Run `npm install eslint-plugin-drizzle --save-dev` and ensure ESM import.
Error: 'drizzle/enforce-update-with-where' is not a valid ESLint rule name.
Rule name mistyped or not registered.
fix
Check rule names: 'enforce-update-with-where', 'drizzle-object-injection', 'invalid-auth-token'.
Upgrade
Version history
0.2.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
eslint-plugin-drizzle — npm install eslint-plugin-drizzle · libregistry