{"id":19731,"library":"eslint-plugin-drizzle","title":"eslint-plugin-drizzle","description":"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.","status":"active","version":"0.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/drizzle-team/drizzle-orm#main","tags":["javascript","eslint","eslintplugin","eslint-plugin","drizzle"],"install":[{"cmd":"npm install eslint-plugin-drizzle","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-drizzle","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-drizzle","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; no CommonJS export. Use dynamic import if needed.","wrong":"const drizzlePlugin = require('eslint-plugin-drizzle')","symbol":"plugin","correct":"import drizzlePlugin from 'eslint-plugin-drizzle'"},{"note":"Named export for rules object; direct subpath import not supported.","wrong":"import rules from 'eslint-plugin-drizzle/rules'","symbol":"rules","correct":"import { rules } from 'eslint-plugin-drizzle'"},{"note":"Rule name in camelCase exported directly; no 'Rule' suffix.","wrong":"import { enforceUpdateDeleteWithWhereRule } from 'eslint-plugin-drizzle'","symbol":"enforceUpdateDeleteWithWhere","correct":"import { enforceUpdateDeleteWithWhere } from 'eslint-plugin-drizzle'"},{"note":"Exported as camelCase without 'Rule' suffix.","wrong":"import { drizzleObjectInjectionRule } from 'eslint-plugin-drizzle'","symbol":"drizzleObjectInjection","correct":"import { drizzleObjectInjection } from 'eslint-plugin-drizzle'"}],"quickstart":{"code":"// .eslintrc.js\nexport default {\n  plugins: {\n    drizzle: await import('eslint-plugin-drizzle')\n  },\n  rules: {\n    'drizzle/enforce-update-with-where': 'error',\n    'drizzle/drizzle-object-injection': 'error',\n    'drizzle/invalid-auth-token': 'warn'\n  }\n};","lang":"javascript","description":"Configures ESLint to use eslint-plugin-drizzle rules, enforcing safe update/delete patterns and preventing SQL injection via object keys."},"warnings":[{"fix":"Use dynamic import or ensure ESLint is configured for ESM.","message":"ESM-only: package does not provide CommonJS export.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use kebab-case in rules object (e.g., 'drizzle/enforce-update-with-where').","message":"Rule names are camelCase but ESLint convention uses kebab-case when referencing in config.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Upgrade ESLint to version 8 or later.","message":"Plugin requires ESLint >=8.0.0.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Update to v0.2.0+ to use the rule.","message":"In v0.2.0, rule 'drizzle-object-injection' was added; prior versions may not have it.","severity":"breaking","affected_versions":"<0.2.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install eslint-plugin-drizzle --save-dev` and ensure ESM import.","cause":"Plugin not installed or CommonJS require used.","error":"Error: Failed to load plugin 'drizzle' declared in '.eslintrc.js': Cannot find module 'eslint-plugin-drizzle'"},{"fix":"Check rule names: 'enforce-update-with-where', 'drizzle-object-injection', 'invalid-auth-token'.","cause":"Rule name mistyped or not registered.","error":"Error: 'drizzle/enforce-update-with-where' is not a valid ESLint rule name."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}