eslint-plugin-drizzle-security 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -58
- package/package.json +2 -2
- package/src/index.js +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<a href="https://eslint.interlace.tools/?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security" target="blank"><img src="https://eslint.interlace.tools/logos/interlace.svg" alt="Interlace" height="90" /></a>
|
|
2
|
+
<a href="https://eslint.interlace.tools/?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security" target="blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://eslint.interlace.tools/logos/interlace-dark.svg"><img src="https://eslint.interlace.tools/logos/interlace-light.svg" alt="Interlace" height="90" /></picture></a>
|
|
3
3
|
|
|
4
4
|
<a href="https://orm.drizzle.team" target="_blank"><img src="https://eslint.interlace.tools/logos/drizzle.svg" alt="Drizzle ORM" height="90" /></a>
|
|
5
5
|
|
|
6
|
-
<a href="https://oxc.rs" target="_blank"><img src="https://eslint.interlace.tools/logos/oxlint.svg" alt="oxlint" height="90" /></a>
|
|
6
|
+
<a href="https://oxc.rs" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://eslint.interlace.tools/logos/oxlint-dark.svg"><img src="https://eslint.interlace.tools/logos/oxlint-light.svg" alt="oxlint" height="90" /></picture></a>
|
|
7
7
|
|
|
8
|
-
<a href="https://eslint.org" target="_blank"><img src="https://eslint.interlace.tools/logos/eslint.svg" alt="ESLint" height="90" /></a>
|
|
8
|
+
<a href="https://eslint.org" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://eslint.interlace.tools/logos/eslint-dark.svg"><img src="https://eslint.interlace.tools/logos/eslint-light.svg" alt="ESLint" height="90" /></picture></a>
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
<p align="center">
|
|
16
16
|
<a href="https://www.npmjs.com/package/eslint-plugin-drizzle-security" target="_blank"><img src="https://img.shields.io/npm/v/eslint-plugin-drizzle-security.svg" alt="NPM Version" /></a>
|
|
17
17
|
<a href="https://www.npmjs.com/package/eslint-plugin-drizzle-security" target="_blank"><img src="https://img.shields.io/npm/dm/eslint-plugin-drizzle-security.svg" alt="NPM Downloads" /></a>
|
|
18
|
+
<a href="https://packagephobia.com/result?p=eslint-plugin-drizzle-security" target="_blank"><img src="https://badgen.net/packagephobia/install/eslint-plugin-drizzle-security" alt="Install Size" /></a>
|
|
18
19
|
<a href="https://opensource.org/licenses/MIT" target="_blank"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="Package License" /></a>
|
|
19
20
|
<a href="https://app.codecov.io/gh/ofri-peretz/eslint/components?components%5B0%5D=eslint-plugin-drizzle-security" target="_blank"><img src="https://codecov.io/gh/ofri-peretz/eslint/graph/badge.svg?component=eslint-plugin-drizzle-security" alt="Codecov" /></a>
|
|
20
21
|
<a href="https://github.com/ofri-peretz/eslint" target="_blank"><img src="https://img.shields.io/badge/Since-Dec_2025-blue?logo=rocket&logoColor=white" alt="Since Dec 2025" /></a>
|
|
@@ -33,57 +34,25 @@ Being Drizzle-specific is what makes the rule precise. It knows which calls are
|
|
|
33
34
|
|
|
34
35
|
The detection itself is shared with the other Interlace driver plugins through `createSqlInjectionRule` — install the one matching your stack and you get exactly one finding per line.
|
|
35
36
|
|
|
36
|
-
## Philosophy
|
|
37
|
-
|
|
38
|
-
**Interlace** fosters **strength through integration**. Instead of stacking isolated rules, we **interlace** security directly into your workflow to create a resilient fabric of code. We believe tools should **guide rather than gatekeep**, providing educational feedback that strengthens the developer with every interaction.
|
|
39
|
-
|
|
40
37
|
<!-- AUTO-GENERATED:DOCTRINE:START - Do not edit manually -->
|
|
41
38
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
That is a trade, and it is made deliberately. It costs recall, and we measure what it
|
|
50
|
-
costs rather than assuming it is free.
|
|
51
|
-
|
|
52
|
-
## How the rules decide
|
|
53
|
-
|
|
54
|
-
**Evidence, not names.** A rule fires on what the code *does*, resolved through the
|
|
55
|
-
AST and ESLint's own scope analysis — not on an identifier that happens to contain
|
|
56
|
-
`query`, a method called `setItem`, or a file whose path contains `key`. Every one of
|
|
57
|
-
those was a real false positive in this ecosystem, found by reading our own output on
|
|
58
|
-
open-source projects and fixed with a test that fails on the unfixed rule.
|
|
59
|
-
|
|
60
|
-
Where a rule has known false-positive shapes, its page carries a **Not a finding**
|
|
61
|
-
section: what it deliberately stays quiet on, and what to check first when it fires
|
|
62
|
-
and you disagree.
|
|
39
|
+
- **Why** — a linter nobody reads protects nothing. We would rather miss a finding
|
|
40
|
+
than spend your attention on one that was never real.
|
|
41
|
+
- **How** — evidence, not names. A rule fires on what the code *does*, resolved
|
|
42
|
+
through the AST and ESLint's own scope analysis.
|
|
43
|
+
- **What** — every finding carries its fix, in prose for a human and as structured
|
|
44
|
+
JSON for an agent. Security rules add a CWE mapping and, where assigned, a CVSS score.
|
|
63
45
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
structured JSON for an agent. Install it, enable
|
|
69
|
-
`recommended`, and read the findings. If one of them is wrong,
|
|
70
|
-
[open an issue](https://github.com/ofri-peretz/eslint/issues) — a false positive is a
|
|
71
|
-
bug here, not a tuning exercise for you.
|
|
72
|
-
|
|
73
|
-
How that is measured, on which projects, and where it falls short:
|
|
74
|
-
[benchmark methodology](https://github.com/ofri-peretz/eslint/blob/main/BENCHMARK-METHODOLOGY.md)
|
|
75
|
-
and [results](https://github.com/ofri-peretz/eslint/blob/main/BENCHMARK-RESULTS.md).
|
|
46
|
+
That trade costs recall, and we measure it:
|
|
47
|
+
[methodology](https://github.com/ofri-peretz/eslint/blob/main/BENCHMARK-METHODOLOGY.md)
|
|
48
|
+
· [results](https://github.com/ofri-peretz/eslint/blob/main/BENCHMARK-RESULTS.md)
|
|
49
|
+
· [a false positive is a bug](https://github.com/ofri-peretz/eslint/issues).
|
|
76
50
|
|
|
77
51
|
<!-- AUTO-GENERATED:DOCTRINE:END -->
|
|
78
52
|
|
|
79
53
|
## Getting Started
|
|
80
54
|
|
|
81
55
|
- To check out the [guide](https://eslint.interlace.tools/docs/security/plugin-drizzle-security?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security), visit [eslint.interlace.tools](https://eslint.interlace.tools/?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security). 📚
|
|
82
|
-
- 要查看中文 [指南](https://eslint.interlace.tools/docs/security/plugin-drizzle-security?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security), 请访问 [eslint.interlace.tools](https://eslint.interlace.tools/?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security). 📚
|
|
83
|
-
- [가이드](https://eslint.interlace.tools/docs/security/plugin-drizzle-security?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security) 문서는 [eslint.interlace.tools](https://eslint.interlace.tools/?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security)에서 확인하실 수 있습니다. 📚
|
|
84
|
-
- [ガイド](https://eslint.interlace.tools/docs/security/plugin-drizzle-security?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security)は [eslint.interlace.tools](https://eslint.interlace.tools/?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security)でご確認ください。 📚
|
|
85
|
-
- Para ver la [guía](https://eslint.interlace.tools/docs/security/plugin-drizzle-security?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security), visita [eslint.interlace.tools](https://eslint.interlace.tools/?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security). 📚
|
|
86
|
-
- للاطلاع على [الدليل](https://eslint.interlace.tools/docs/security/plugin-drizzle-security?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security)، قم بزيارة [eslint.interlace.tools](https://eslint.interlace.tools/?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security). 📚
|
|
87
56
|
|
|
88
57
|
```bash
|
|
89
58
|
npm install eslint-plugin-drizzle-security --save-dev
|
|
@@ -162,23 +131,52 @@ See the [ESLint Version Support Policy](../../docs/ESLINT_VERSION_SUPPORT.md)
|
|
|
162
131
|
| [no-unsafe-query](https://eslint.interlace.tools/docs/security/plugin-drizzle-security/rules/no-unsafe-query?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security) | CWE-89 | A03:2021 | | Prevent SQL injection by disallowing string concatenation or interpolated template literals in Drizzle sql.… | 🟢 | 💼 | | | | |
|
|
163
132
|
| [no-unscoped-mutation](https://eslint.interlace.tools/docs/security/plugin-drizzle-security/rules/no-unscoped-mutation?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security) | CWE-284 | A01:2021 | | Require a chained `.where()` on Drizzle delete and update builders, so a bulk mutation cannot rewrite or de… | 🟢 | | | | | |
|
|
164
133
|
<!-- AUTO-GENERATED:RULES_TABLE:END -->
|
|
134
|
+
<!-- AUTO-GENERATED:ECOSYSTEM_TABLE:START - Do not edit manually -->
|
|
135
|
+
|
|
165
136
|
## 🔗 Related ESLint Plugins
|
|
166
137
|
|
|
167
|
-
Part of the **Interlace ESLint
|
|
138
|
+
Part of the **Interlace ESLint ecosystem** — AI-native rules with LLM-optimized error messages:
|
|
139
|
+
|
|
140
|
+
**Security**
|
|
141
|
+
|
|
142
|
+
| Plugin | Downloads | Description |
|
|
143
|
+
| :--- | :---: | :--- |
|
|
144
|
+
| [`eslint-plugin-anthropic-security`](https://www.npmjs.com/package/eslint-plugin-anthropic-security) | [](https://www.npmjs.com/package/eslint-plugin-anthropic-security) | Anthropic SDK security. |
|
|
145
|
+
| [`eslint-plugin-browser-security`](https://www.npmjs.com/package/eslint-plugin-browser-security) | [](https://www.npmjs.com/package/eslint-plugin-browser-security) | XSS, DOM security. |
|
|
146
|
+
| [`eslint-plugin-express-security`](https://www.npmjs.com/package/eslint-plugin-express-security) | [](https://www.npmjs.com/package/eslint-plugin-express-security) | Express middleware hardening. |
|
|
147
|
+
| [`eslint-plugin-gemini-security`](https://www.npmjs.com/package/eslint-plugin-gemini-security) | [](https://www.npmjs.com/package/eslint-plugin-gemini-security) | Google Gemini SDK security. |
|
|
148
|
+
| [`eslint-plugin-jwt-security`](https://www.npmjs.com/package/eslint-plugin-jwt-security) | [](https://www.npmjs.com/package/eslint-plugin-jwt-security) | Token security. |
|
|
149
|
+
| [`eslint-plugin-knex-security`](https://www.npmjs.com/package/eslint-plugin-knex-security) | [](https://www.npmjs.com/package/eslint-plugin-knex-security) | Knex security. |
|
|
150
|
+
| [`eslint-plugin-lambda-security`](https://www.npmjs.com/package/eslint-plugin-lambda-security) | [](https://www.npmjs.com/package/eslint-plugin-lambda-security) | AWS Lambda hardening. |
|
|
151
|
+
| [`eslint-plugin-mcp-sdk-security`](https://www.npmjs.com/package/eslint-plugin-mcp-sdk-security) | [](https://www.npmjs.com/package/eslint-plugin-mcp-sdk-security) | MCP SDK security. |
|
|
152
|
+
| [`eslint-plugin-mongodb-security`](https://www.npmjs.com/package/eslint-plugin-mongodb-security) | [](https://www.npmjs.com/package/eslint-plugin-mongodb-security) | MongoDB injection. |
|
|
153
|
+
| [`eslint-plugin-mysql-security`](https://www.npmjs.com/package/eslint-plugin-mysql-security) | [](https://www.npmjs.com/package/eslint-plugin-mysql-security) | MySQL security. |
|
|
154
|
+
| [`eslint-plugin-nestjs-security`](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | [](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | NestJS framework hardening. |
|
|
155
|
+
| [`eslint-plugin-node-security`](https://www.npmjs.com/package/eslint-plugin-node-security) | [](https://www.npmjs.com/package/eslint-plugin-node-security) | Server-side patterns. |
|
|
156
|
+
| [`eslint-plugin-openai-security`](https://www.npmjs.com/package/eslint-plugin-openai-security) | [](https://www.npmjs.com/package/eslint-plugin-openai-security) | OpenAI SDK security. |
|
|
157
|
+
| [`eslint-plugin-postgresql-security`](https://www.npmjs.com/package/eslint-plugin-postgresql-security) | [](https://www.npmjs.com/package/eslint-plugin-postgresql-security) | PostgreSQL security. |
|
|
158
|
+
| [`eslint-plugin-prisma-security`](https://www.npmjs.com/package/eslint-plugin-prisma-security) | [](https://www.npmjs.com/package/eslint-plugin-prisma-security) | Prisma security. |
|
|
159
|
+
| [`eslint-plugin-secure-coding`](https://www.npmjs.com/package/eslint-plugin-secure-coding) | [](https://www.npmjs.com/package/eslint-plugin-secure-coding) | Injection prevention. |
|
|
160
|
+
| [`eslint-plugin-sequelize-security`](https://www.npmjs.com/package/eslint-plugin-sequelize-security) | [](https://www.npmjs.com/package/eslint-plugin-sequelize-security) | Sequelize ORM security. |
|
|
161
|
+
| [`eslint-plugin-sqlite-security`](https://www.npmjs.com/package/eslint-plugin-sqlite-security) | [](https://www.npmjs.com/package/eslint-plugin-sqlite-security) | SQLite security. |
|
|
162
|
+
| [`eslint-plugin-typeorm-security`](https://www.npmjs.com/package/eslint-plugin-typeorm-security) | [](https://www.npmjs.com/package/eslint-plugin-typeorm-security) | TypeORM security. |
|
|
163
|
+
| [`eslint-plugin-vercel-ai-security`](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | [](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | AI SDK security. |
|
|
164
|
+
|
|
165
|
+
**Code quality**
|
|
168
166
|
|
|
169
167
|
| Plugin | Downloads | Description |
|
|
170
168
|
| :--- | :---: | :--- |
|
|
171
|
-
| [`eslint-plugin-
|
|
172
|
-
| [`eslint-plugin-
|
|
173
|
-
| [`eslint-plugin-
|
|
174
|
-
| [`eslint-plugin-
|
|
175
|
-
| [`eslint-plugin-
|
|
176
|
-
| [`eslint-plugin-
|
|
177
|
-
| [`eslint-plugin-
|
|
178
|
-
| [`eslint-plugin-
|
|
179
|
-
| [`eslint-plugin-
|
|
180
|
-
|
|
181
|
-
|
|
169
|
+
| [`eslint-plugin-conventions`](https://www.npmjs.com/package/eslint-plugin-conventions) | [](https://www.npmjs.com/package/eslint-plugin-conventions) | Team-specific habits and styles. |
|
|
170
|
+
| [`eslint-plugin-import-next`](https://www.npmjs.com/package/eslint-plugin-import-next) | [](https://www.npmjs.com/package/eslint-plugin-import-next) | Fast cycle + import-graph analysis. |
|
|
171
|
+
| [`eslint-plugin-maintainability`](https://www.npmjs.com/package/eslint-plugin-maintainability) | [](https://www.npmjs.com/package/eslint-plugin-maintainability) | Cognitive load and clean-code patterns. |
|
|
172
|
+
| [`eslint-plugin-modernization`](https://www.npmjs.com/package/eslint-plugin-modernization) | [](https://www.npmjs.com/package/eslint-plugin-modernization) | ESNext migration + syntax evolution. |
|
|
173
|
+
| [`eslint-plugin-modularity`](https://www.npmjs.com/package/eslint-plugin-modularity) | [](https://www.npmjs.com/package/eslint-plugin-modularity) | Structural integrity and DDD patterns. |
|
|
174
|
+
| [`eslint-plugin-operability`](https://www.npmjs.com/package/eslint-plugin-operability) | [](https://www.npmjs.com/package/eslint-plugin-operability) | Production readiness and resource health. |
|
|
175
|
+
| [`eslint-plugin-react-a11y`](https://www.npmjs.com/package/eslint-plugin-react-a11y) | [](https://www.npmjs.com/package/eslint-plugin-react-a11y) | React accessibility / WCAG. |
|
|
176
|
+
| [`eslint-plugin-react-features`](https://www.npmjs.com/package/eslint-plugin-react-features) | [](https://www.npmjs.com/package/eslint-plugin-react-features) | React best practices and optimization. |
|
|
177
|
+
| [`eslint-plugin-reliability`](https://www.npmjs.com/package/eslint-plugin-reliability) | [](https://www.npmjs.com/package/eslint-plugin-reliability) | Runtime stability and error safety. |
|
|
178
|
+
|
|
179
|
+
<!-- AUTO-GENERATED:ECOSYSTEM_TABLE:END -->
|
|
182
180
|
|
|
183
181
|
<!-- INTERLACE:STAR_CTA:START -->
|
|
184
182
|
## ⭐ Support & follow
|
|
@@ -198,5 +196,5 @@ MIT © [Ofri Peretz](https://github.com/ofri-peretz)
|
|
|
198
196
|
</p>
|
|
199
197
|
|
|
200
198
|
<p align="center">
|
|
201
|
-
<a href="https://eslint.interlace.tools/?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security" target="blank"><img src="https://eslint.interlace.tools/
|
|
199
|
+
<a href="https://eslint.interlace.tools/?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-drizzle-security" target="blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://eslint.interlace.tools/logos/interlace-dark.svg"><img src="https://eslint.interlace.tools/logos/interlace-light.svg" alt="Interlace" height="70" /></picture></a>
|
|
202
200
|
</p>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-drizzle-security",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "ESLint plugin for drizzle-orm — detects SQL injection in raw queries built with string concatenation or template literals.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@interlace/eslint-devkit": "^1.
|
|
79
|
+
"@interlace/eslint-devkit": "^1.18.2"
|
|
80
80
|
},
|
|
81
81
|
"funding": {
|
|
82
82
|
"type": "github",
|
package/src/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.configs=exports.plugin=exports.rules=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.rules={get"no-mass-assignment"(){return require("./rules/no-mass-assignment").noMassAssignment},get"no-raw-identifier-interpolation"(){return require("./rules/no-raw-identifier-interpolation").noRawIdentifierInterpolation},get"no-unsafe-query"(){return require("./rules/no-unsafe-query").noUnsafeQuery},get"no-unscoped-mutation"(){return require("./rules/no-unscoped-mutation").noUnscopedMutation}};(0,eslint_devkit_1.withCanonicalDocsUrls)("plugin-drizzle-security",exports.rules);exports.plugin={meta:{name:"eslint-plugin-drizzle-security",version:"0.3.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.configs=exports.plugin=exports.rules=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.rules={get"no-mass-assignment"(){return require("./rules/no-mass-assignment").noMassAssignment},get"no-raw-identifier-interpolation"(){return require("./rules/no-raw-identifier-interpolation").noRawIdentifierInterpolation},get"no-unsafe-query"(){return require("./rules/no-unsafe-query").noUnsafeQuery},get"no-unscoped-mutation"(){return require("./rules/no-unscoped-mutation").noUnscopedMutation}};(0,eslint_devkit_1.withCanonicalDocsUrls)("plugin-drizzle-security",exports.rules);exports.plugin={meta:{name:"eslint-plugin-drizzle-security",version:"0.3.6"},rules:exports.rules};exports.configs={flagship:{plugins:{"drizzle-security":exports.plugin},rules:{"drizzle-security/no-unsafe-query":"error"}},recommended:{plugins:{"drizzle-security":exports.plugin},rules:{"drizzle-security/no-unsafe-query":"error"}},strict:{plugins:{"drizzle-security":exports.plugin},rules:Object.fromEntries(Object.keys(exports.rules).map(ruleName=>[`drizzle-security/${ruleName}`,"error"]))}};exports.default=exports.plugin;
|