Gathering detailed insights and metrics for eslint-plugin-drizzle
Gathering detailed insights and metrics for eslint-plugin-drizzle
Gathering detailed insights and metrics for eslint-plugin-drizzle
Gathering detailed insights and metrics for eslint-plugin-drizzle
Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
npm install eslint-plugin-drizzle
Typescript
Module System
Node Version
NPM Version
93.7
Supply Chain
92.3
Quality
96.9
Maintenance
100
Vulnerability
98.9
License
TypeScript (98.67%)
JavaScript (1.33%)
Total Downloads
3,196,203
Last Day
3,840
Last Week
66,995
Last Month
299,942
Last Year
2,655,936
Apache-2.0 License
30,052 Stars
2,873 Commits
1,010 Forks
61 Watchers
28 Branches
134 Contributors
Updated on Aug 31, 2025
Latest Version
0.2.3
Package Id
eslint-plugin-drizzle@0.2.3
Unpacked Size
14.33 kB
Size
3.43 kB
File Count
9
NPM Version
10.2.3
Node Version
18.19.0
Published on
Dec 25, 2023
Cumulative downloads
Total Downloads
Last Day
-9.2%
3,840
Compared to previous day
Last Week
-11.4%
66,995
Compared to previous week
Last Month
4.7%
299,942
Compared to previous month
Last Year
391.6%
2,655,936
Compared to previous year
1
For cases where it's impossible to perform type checks for specific scenarios, or where it's possible but error messages would be challenging to understand, we've decided to create an ESLint package with recommended rules. This package aims to assist developers in handling crucial scenarios during development
Big thanks to @Angelelz for initiating the development of this package and transferring it to the Drizzle Team's npm
1[ npm | yarn | pnpm | bun ] install eslint eslint-plugin-drizzle
You can install those packages for typescript support in your IDE
1[ npm | yarn | pnpm | bun ] install @typescript-eslint/eslint-plugin @typescript-eslint/parser
Create a .eslintrc.yml
file, add drizzle
to the plugins
, and specify the rules you want to use. You can find a list of all existing rules below
1root: true 2parser: '@typescript-eslint/parser' 3parserOptions: 4 project: './tsconfig.json' 5plugins: 6 - drizzle 7rules: 8 'drizzle/enforce-delete-with-where': "error" 9 'drizzle/enforce-update-with-where': "error"
This plugin exports an all
config that makes use of all rules (except for deprecated ones).
1root: true 2extends: 3 - "plugin:drizzle/all" 4parser: '@typescript-eslint/parser' 5parserOptions: 6 project: './tsconfig.json' 7plugins: 8 - drizzle
At the moment, all
is equivalent to recommended
1root: true 2extends: 3 - "plugin:drizzle/recommended" 4parser: '@typescript-eslint/parser' 5parserOptions: 6 project: './tsconfig.json' 7plugins: 8 - drizzle
enforce-delete-with-where: Enforce using delete
with the.where()
clause in the .delete()
statement. Most of the time, you don't need to delete all rows in the table and require some kind of WHERE
statements.
Optionally, you can define a drizzleObjectName
in the plugin options that accept a string
or string[]
. This is useful when you have objects or classes with a delete method that's not from Drizzle. Such a delete
method will trigger the ESLint rule. To avoid that, you can define the name of the Drizzle object that you use in your codebase (like db) so that the rule would only trigger if the delete method comes from this object:
Example, config 1:
1"rules": { 2 "drizzle/enforce-delete-with-where": ["error"] 3}
1class MyClass { 2 public delete() { 3 return {} 4 } 5} 6 7const myClassObj = new MyClass(); 8 9// ---> Will be triggered by ESLint Rule 10myClassObj.delete() 11 12const db = drizzle(...) 13// ---> Will be triggered by ESLint Rule 14db.delete()
Example, config 2:
1"rules": { 2 "drizzle/enforce-delete-with-where": ["error", { "drizzleObjectName": ["db"] }], 3}
1class MyClass { 2 public delete() { 3 return {} 4 } 5} 6 7const myClassObj = new MyClass(); 8 9// ---> Will NOT be triggered by ESLint Rule 10myClassObj.delete() 11 12const db = drizzle(...) 13// ---> Will be triggered by ESLint Rule 14db.delete()
enforce-update-with-where: Enforce using update
with the.where()
clause in the .update()
statement. Most of the time, you don't need to update all rows in the table and require some kind of WHERE
statements.
Optionally, you can define a drizzleObjectName
in the plugin options that accept a string
or string[]
. This is useful when you have objects or classes with a delete method that's not from Drizzle. Such as update
method will trigger the ESLint rule. To avoid that, you can define the name of the Drizzle object that you use in your codebase (like db) so that the rule would only trigger if the delete method comes from this object:
Example, config 1:
1"rules": { 2 "drizzle/enforce-update-with-where": ["error"] 3}
1class MyClass { 2 public update() { 3 return {} 4 } 5} 6 7const myClassObj = new MyClass(); 8 9// ---> Will be triggered by ESLint Rule 10myClassObj.update() 11 12const db = drizzle(...) 13// ---> Will be triggered by ESLint Rule 14db.update()
Example, config 2:
1"rules": { 2 "drizzle/enforce-update-with-where": ["error", { "drizzleObjectName": ["db"] }], 3}
1class MyClass { 2 public update() { 3 return {} 4 } 5} 6 7const myClassObj = new MyClass(); 8 9// ---> Will NOT be triggered by ESLint Rule 10myClassObj.update() 11 12const db = drizzle(...) 13// ---> Will be triggered by ESLint Rule 14db.update()
No vulnerabilities found.