eslint-plugin-ai-guard 1.1.13 โ†’ 1.2.0

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 CHANGED
@@ -1,233 +1,337 @@
1
- <p align="center">
2
- <h1 align="center">eslint-plugin-ai-guard</h1>
3
- <p align="center">
4
- <strong>๐Ÿ›ก๏ธ ESLint plugin that catches the code patterns AI tools get wrong most often.</strong>
5
- </p>
6
- <p align="center">
7
- <a href="https://www.npmjs.com/package/eslint-plugin-ai-guard"><img src="https://img.shields.io/npm/v/eslint-plugin-ai-guard.svg?style=flat-square" alt="npm version"></a>
8
- <a href="https://github.com/YashJadhav21/eslint-plugin-ai-guard/actions"><img src="https://img.shields.io/github/actions/workflow/status/YashJadhav21/eslint-plugin-ai-guard/ci.yml?style=flat-square&label=CI" alt="CI"></a>
9
- <a href="https://www.npmjs.com/package/eslint-plugin-ai-guard"><img src="https://img.shields.io/npm/dm/eslint-plugin-ai-guard.svg?style=flat-square" alt="downloads"></a>
10
- <a href="https://github.com/YashJadhav21/eslint-plugin-ai-guard/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/eslint-plugin-ai-guard.svg?style=flat-square" alt="license"></a>
11
- </p>
12
- </p>
13
-
14
- ---
15
-
16
- AI-generated code has **1.7ร— more issues** and **2.74ร— more security vulnerabilities** than human code ([CodeRabbit 2025](https://www.coderabbit.ai/)). Existing linters catch human mistakes โ€” `ai-guard` catches the patterns AI tools consistently get wrong: empty catch blocks, floating promises, async array misuse, and more.
17
-
18
- ## Install
19
-
20
- ```bash
21
- npm install --save-dev eslint-plugin-ai-guard
22
- ```
23
-
24
- ## ๐Ÿš€ Quick Start โ€“ CLI (no config needed)
25
-
26
- ```bash
27
- npx ai-guard run # recommended preset (lowest noise)
28
- npx ai-guard run --strict
29
- npx ai-guard run --security
30
- npx ai-guard init # auto-creates ESLint config for you
31
- npx ai-guard init --dry-run
32
- npx ai-guard doctor # diagnoses setup issues
33
- npx ai-guard baseline # track only *new* issues going forward
34
- ```
35
- That's it. **Zero configuration required.**
36
-
37
- ## ๐Ÿค– Set Up AI Agent Rules
38
-
39
- Generate instruction files so Claude Code, Cursor, and GitHub Copilot
40
- automatically avoid the 17 most common AI-generated anti-patterns:
41
-
42
- ```bash
43
- npx ai-guard init-context
44
- ```
45
-
46
- Follow the prompts to select your agent(s). Or generate all at once:
47
-
48
- ```bash
49
- npx ai-guard init-context --all
50
- ```
51
-
52
- This writes:
53
- - `CLAUDE.md` โ€” read automatically by Claude Code
54
- - `.cursorrules` โ€” read automatically by Cursor
55
- - `.github/copilot-instructions.md` โ€” read automatically by GitHub Copilot
56
-
57
- Your AI tools will now avoid these patterns before you even run the linter.
58
- Use `--force` to regenerate after upgrading to a new version with new rules.
59
-
60
- ## ๐Ÿงช Real-World Usage Philosophy
61
-
62
- `ai-guard` is designed for production adoption in existing codebases:
63
-
64
- 1. **Recommended preset is intentionally low-noise** to avoid overwhelming teams on day one.
65
- 2. **Strict preset enables full enforcement** for mature teams that want maximum coverage.
66
- 3. **Security preset focuses only on security rules** with critical issues as errors.
67
-
68
- ## ๐Ÿ› ๏ธ Safe Autofix Support
69
-
70
- `ai-guard` now includes safe autofixers for selected high-confidence rules:
71
-
72
- - `ai-guard/no-empty-catch` โ†’ inserts `{ /* TODO: handle error */ }`
73
- - `ai-guard/no-await-in-loop` โ†’ rewrites simple independent loops to `await Promise.all(...)`
74
- - `ai-guard/no-hardcoded-secret` โ†’ replaces hardcoded literals with `process.env.*`
75
- - `ai-guard/no-floating-promise` โ†’ marks intentional fire-and-forget with `void`
76
- - `ai-guard/no-async-without-await` โ†’ inserts `await (...)` for simple function bodies
77
-
78
- These fixes are intentionally conservative and avoid complex transformations when confidence is low.
79
-
80
- ## ๐ŸŽฌ Real Workspace Demo
81
-
82
- See how `ai-guard` catches a common AI-generated async bug that silent failures in production:
83
-
84
- ```typescript
85
- // โŒ BAD: AI often forgets to await or wrap in Promise.all
86
- const userIds = [1, 2, 3];
87
- userIds.map(async (id) => {
88
- return await fetchUser(id);
89
- });
90
- // โš ๏ธ ai-guard flags: Async callback passed to Array.map(). Returns Promise[], not values.
91
-
92
- // โœ… GOOD: ai-guard recommended fix
93
- const users = await Promise.all(userIds.map(async (id) => {
94
- return await fetchUser(id);
95
- }));
96
- // โœจ ai-guard: No issues found.
97
- ```
98
-
99
- ### Terminal Output
100
-
101
- ![ai-guard linting demo](./assets/example_1.png)
102
- ![ai-guard linting demo](./assets/example_2.png)
103
-
104
- *The terminal output above shows `ai-guard` catching multiple AI-generated anti-patterns in a single run.*
105
-
106
- ## Rules (Recommended Preset)
107
-
108
- ### ๐ŸŽฏ Error Handling
109
-
110
- - **`ai-guard/no-empty-catch`** (Error)
111
- Disallow empty catch blocks. Includes safe autofix that inserts an explicit placeholder handler comment.
112
- - **`ai-guard/no-broad-exception`** (Warn)
113
- Disallow catching `any` or `unknown` without instance narrowing. AI tools default to `catch (e: any)` which obscures the underlying failure.
114
- - **`ai-guard/no-catch-log-rethrow`** (Off in `recommended`, Error in `strict`)
115
- Disallow catch blocks that only log and rethrow the same error. AI tools often generate this noisy pattern without adding recovery or context.
116
- - **`ai-guard/no-catch-without-use`** (Off in `recommended`, Error in `strict`)
117
- Disallow unused catch parameters. AI tools frequently add `catch (e)` while ignoring the error object entirely.
118
- - **`ai-guard/no-duplicate-logic-block`** (Off in `recommended`, Error in `strict`)
119
- Disallow consecutive duplicated logic blocks. AI tools often copy-paste identical code that should be consolidated.
120
-
121
- ### โฑ๏ธ Async Stability
122
-
123
- - **`ai-guard/no-async-array-callback`** (Warn)
124
- Disallow async functions in `.map()`, `.filter()`, etc. AI tools frequently suggest `array.map(async ...)` expecting resolved values, creating silent bugs.
125
- - **`ai-guard/no-floating-promise`** (Error)
126
- Require awaiting or handling promises. Includes safe autofix that marks floating calls with `void`.
127
- - **`ai-guard/no-await-in-loop`** (Warn)
128
- Disallow independent sequential `await` inside loops. Intent-aware suppression protects retry/fallback loops, and safe autofix is available for simple independent cases.
129
- - **`ai-guard/no-async-without-await`** (Warn)
130
- Disallow async functions that do not use `await`. Includes safe autofix for simple bodies by inserting explicit await.
131
- - **`ai-guard/no-redundant-await`** (Off in `recommended`, Error in `strict`)
132
- Disallow redundant `return await` outside try/catch/finally. AI tools often emit this pattern even when returning the Promise directly is equivalent.
133
-
134
- ### ๐Ÿ›ก๏ธ Security
135
-
136
- - **`ai-guard/no-hardcoded-secret`** (Error)
137
- Disallow hardcoded keys/passwords. Includes safe autofix that rewrites values to `process.env.*`.
138
- - **`ai-guard/no-eval-dynamic`** (Error)
139
- Disallow dynamic `eval()` or `new Function()`.
140
- - **`ai-guard/no-sql-string-concat`** (Warn in `recommended`, Error in `security`/`strict`)
141
- Disallow variable concatenation/interpolation in SQL queries. Now context-aware for known query builders (Knex, Drizzle, Prisma, Kysely, Sequelize, TypeORM, Mikro-ORM) to reduce false positives while staying strict for non-builder sinks.
142
- - **`ai-guard/no-unsafe-deserialize`** (Warn in `recommended`/`security`, Error in `strict`)
143
- Disallow `JSON.parse()` on likely untrusted inputs (like `req.body`) without visible validation.
144
- - **`ai-guard/require-auth-middleware`** (Warn)
145
- Enforce authentication middleware on Express/Fastify routes. AI tools frequently generate unprotected endpoints exposing sensitive data.
146
- - **`ai-guard/require-authz-check`** (Warn in `recommended`/`security`, Error in `strict`)
147
- Require visible ownership/authorization checks when handlers access resource identifiers (like `req.params.id`).
148
-
149
- ### ๐Ÿงน Code Quality
150
-
151
- - **`ai-guard/no-console-in-handler`** (Off in `recommended`, Error in `strict`)
152
- Disallow `console.*` inside HTTP route handlers. AI tools often leave debug logs in handlers that leak internals and pollute production logs.
153
-
154
- ### Configs
155
-
156
- | Config | Description |
157
- | --- | --- |
158
- | `recommended` | Adoption-first preset: high-confidence issues as `error`, context-sensitive rules as `warn`/`off` |
159
- | `strict` | All rules at `error` โ€” for teams that want maximum coverage |
160
- | `security` | Security-only rules: critical issues at `error`, contextual checks at `warn` |
161
-
162
- ### Config Examples
163
-
164
- #### Flat Config: strict
165
-
166
- ```javascript
167
- import aiGuard from "eslint-plugin-ai-guard";
168
-
169
- export default [
170
- {
171
- plugins: { "ai-guard": aiGuard },
172
- rules: { ...aiGuard.configs.strict.rules }
173
- }
174
- ];
175
- ```
176
-
177
- #### Flat Config: security
178
-
179
- ```javascript
180
- import aiGuard from "eslint-plugin-ai-guard";
181
-
182
- export default [
183
- {
184
- plugins: { "ai-guard": aiGuard },
185
- rules: { ...aiGuard.configs.security.rules }
186
- }
187
- ];
188
- ```
189
-
190
- ## Why This Exists
191
-
192
- AI coding assistants generate code that **looks correct** but has subtle structural issues:
193
-
194
- - ๐Ÿ•ณ๏ธ **Empty catch blocks** โ€” errors vanish silently
195
- - โณ **`array.map(async ...)`** โ€” returns `Promise[]`, not resolved values
196
- - ๐Ÿ”ฅ **Floating promises** โ€” `fetchData()` without `await` = silent failures
197
-
198
- These patterns pass TypeScript and existing linters. `ai-guard` catches them.
199
-
200
- ## Supported Environments
201
-
202
- - **ESLint** 8.x and 9.x (flat config)
203
- - **Node.js** โ‰ฅ 18
204
- - **TypeScript** and JavaScript
205
-
206
- ## Development
207
-
208
- ```bash
209
- git clone https://github.com/YashJadhav21/eslint-plugin-ai-guard.git
210
- cd eslint-plugin-ai-guard
211
- npm install
212
- npm run test # Run test suite
213
- npm run build # Build CJS + ESM
214
- npm run typecheck # TypeScript check
215
- ```
216
-
217
- ## Contributing
218
-
219
- Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
220
-
221
- **Rule requests:** Open an issue using the [Rule Request template](https://github.com/YashJadhav21/eslint-plugin-ai-guard/issues/new).
222
-
223
- **False positive reports:** Open an issue using the [False Positive template](https://github.com/YashJadhav21/eslint-plugin-ai-guard/issues/new) โ€” we take zero false positives seriously.
224
-
225
- ## License
226
-
227
- [MIT](LICENSE) โ€” free forever. No rules behind a paywall.
228
-
229
- ---
230
-
231
- <p align="center">
232
- Built to make AI-assisted development safer. โšก
233
- </p>
1
+ <p align="center">
2
+ <img src="./assets/logo.png" alt="AI Guard Logo" width="80" />
3
+ <h1 align="center">eslint-plugin-ai-guard</h1>
4
+ <p align="center">
5
+ <strong>๐Ÿ›ก๏ธ The ESLint plugin built for the age of AI-generated code.</strong>
6
+ </p>
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/eslint-plugin-ai-guard"><img src="https://img.shields.io/npm/v/eslint-plugin-ai-guard.svg?style=flat-square&color=7c3aed" alt="npm version"></a>
9
+ <a href="https://github.com/YashJadhav21/eslint-plugin-ai-guard/actions"><img src="https://img.shields.io/github/actions/workflow/status/YashJadhav21/eslint-plugin-ai-guard/ci.yml?style=flat-square&label=CI&color=10b981" alt="CI"></a>
10
+ <a href="https://www.npmjs.com/package/eslint-plugin-ai-guard"><img src="https://img.shields.io/npm/dm/eslint-plugin-ai-guard.svg?style=flat-square&color=3b82f6" alt="downloads"></a>
11
+ <a href="https://github.com/YashJadhav21/eslint-plugin-ai-guard/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/eslint-plugin-ai-guard.svg?style=flat-square&color=64748b" alt="license"></a>
12
+ </p>
13
+ </p>
14
+
15
+ ---
16
+
17
+ ## The Problem
18
+
19
+ AI coding assistants generate code that **looks correct but isn't.** Research shows AI-generated code has **1.7ร— more bugs** and **2.74ร— more security vulnerabilities** than human-written code.
20
+
21
+ The patterns they get wrong are consistent and predictable:
22
+
23
+ | Pattern | Why AI Gets It Wrong |
24
+ |---------|---------------------|
25
+ | `try {} catch (e) {}` | AI adds catch blocks without thinking about error handling |
26
+ | `array.map(async ...)` | AI generates async callbacks that return `Promise[]`, not values |
27
+ | `fetch(url)` (no await) | AI forgets to await or handle promise rejection |
28
+ | `const apiKey = 'sk-...'` | AI uses placeholder credentials that get committed |
29
+ | `eval(userInput)` | AI generates dynamic evaluation without security awareness |
30
+ | `if (true) { ... }` | AI leaves dead scaffolding branches in generated code |
31
+
32
+ **Existing linters don't catch these** because they're designed for human coding patterns.
33
+
34
+ `ai-guard` is purpose-built to catch what AI tools consistently get wrong.
35
+
36
+ ---
37
+
38
+ ## Install
39
+
40
+ ```bash
41
+ npm install --save-dev eslint-plugin-ai-guard
42
+ ```
43
+
44
+ Requires: **Node.js โ‰ฅ 18**, **ESLint โ‰ฅ 8**
45
+
46
+ ---
47
+
48
+ ## Quick Start โ€” Zero Config Required
49
+
50
+ ```bash
51
+ # Scan your project immediately (no ESLint config needed)
52
+ npx ai-guard run
53
+
54
+ # Security-focused scan
55
+ npx ai-guard run --security
56
+
57
+ # Strict mode โ€” all rules at error
58
+ npx ai-guard run --strict
59
+
60
+ # Scan a specific directory
61
+ npx ai-guard run --path src/api
62
+ ```
63
+
64
+ **That's it.** No configuration, no setup.
65
+
66
+ ---
67
+
68
+ ## CLI Commands
69
+
70
+ | Command | Description |
71
+ |---------|-------------|
72
+ | `ai-guard run` | Scan your project with the recommended preset |
73
+ | `ai-guard run --strict` | All rules at error โ€” for CI enforcement |
74
+ | `ai-guard run --security` | Security rules only |
75
+ | `ai-guard run --json` | Output results as JSON (CI-friendly) |
76
+ | `ai-guard run --max-warnings 0` | Fail CI on any warning |
77
+ | `ai-guard init` | Auto-configure ESLint for your project |
78
+ | `ai-guard init-context` | Generate AI agent rules (CLAUDE.md, .cursorrules, etc.) |
79
+ | `ai-guard doctor` | Diagnose your ESLint setup |
80
+ | `ai-guard baseline` | Save current issues, track only new ones |
81
+ | `ai-guard report` | Generate a shareable HTML report |
82
+ | `ai-guard ignore` | Add patterns to suppress noise |
83
+
84
+ ### Terminal Output
85
+
86
+ ```
87
+ AI GUARD
88
+
89
+ Files scanned: 142 ยท Issues in: 7 files ยท Duration: 312ms ยท Preset: recommended
90
+
91
+ โ”€โ”€ Summary by Category โ”€โ”€
92
+
93
+ ๐Ÿ”ด Security 3 errors
94
+ ๐ŸŸ  Reliability 2 errors
95
+ ๐ŸŸก Async Stability 2 warnings
96
+
97
+ Total: 5 errors ยท 2 warnings
98
+
99
+ โ”€โ”€ By Rule โ”€โ”€
100
+ โ€ข no-hardcoded-secret: 3
101
+ โ€ข no-empty-catch: 2
102
+ โ€ข no-floating-promise: 2
103
+
104
+ โ”€โ”€ Next Steps โ”€โ”€
105
+ โ„น Run ai-guard baseline to save these issues and track only new ones
106
+ โ„น Run ai-guard report to generate a shareable HTML report
107
+ ```
108
+
109
+ ---
110
+
111
+ ## Rules
112
+
113
+ ### ๐Ÿ”ด Security
114
+
115
+ | Rule | Default | What it catches |
116
+ |------|---------|-----------------|
117
+ | `no-hardcoded-secret` | **error** | API keys, passwords, tokens in source code. Autofix: replaces with `process.env.*` |
118
+ | `no-eval-dynamic` | **error** | `eval()` / `new Function()` with non-literal arguments |
119
+ | `no-sql-string-concat` | warn | SQL queries built by string concatenation or interpolation |
120
+ | `no-unsafe-deserialize` | warn | `JSON.parse(req.body)` without validation |
121
+ | `require-auth-middleware` | warn | Express/Fastify routes without authentication middleware |
122
+ | `require-authz-check` | warn | Resource access without ownership checks |
123
+
124
+ ### ๐ŸŸ  Reliability
125
+
126
+ | Rule | Default | What it catches |
127
+ |------|---------|-----------------|
128
+ | `no-empty-catch` | **error** | `catch (e) {}` โ€” errors vanish silently. Autofix: inserts `/* TODO: handle error */` |
129
+ | `no-broad-exception` | warn | `catch (e: any)` that hides the real error type |
130
+ | `no-catch-log-rethrow` | off* | Catch blocks that only `console.log` + rethrow |
131
+ | `no-catch-without-use` | off* | Catching an error and never using it |
132
+
133
+ *Enabled at `error` in `strict` preset.
134
+
135
+ ### ๐ŸŸก Async Stability
136
+
137
+ | Rule | Default | What it catches |
138
+ |------|---------|-----------------|
139
+ | `no-floating-promise` | **error** | Async calls with no `await`, return, or `.catch()`. Autofix: adds `void` |
140
+ | `no-async-array-callback` | warn | `array.map(async ...)` returning `Promise[]` instead of values |
141
+ | `no-await-in-loop` | warn | Sequential `await` in loops (use `Promise.all`). Autofix available for simple cases |
142
+ | `no-async-without-await` | warn | `async` function that never uses `await` |
143
+ | `no-redundant-await` | off* | `return await` outside try/catch |
144
+
145
+ *Enabled at `error` in `strict` preset.
146
+
147
+ ### ๐Ÿ”ต AI Patterns
148
+
149
+ | Rule | Default | What it catches |
150
+ |------|---------|-----------------|
151
+ | `no-dead-branch` | warn | `if (true)`, `if (false)`, `x && !x`, `x === x` โ€” scaffolding leftovers |
152
+ | `no-duplicate-logic-block` | off* | Consecutive duplicate code that should be extracted |
153
+ | `no-console-in-handler` | off* | `console.log` in route handlers (use a proper logger) |
154
+
155
+ *Enabled at `error` in `strict` preset.
156
+
157
+ ---
158
+
159
+ ## Presets
160
+
161
+ | Preset | Purpose | Recommended For |
162
+ |--------|---------|-----------------|
163
+ | `recommended` | Low-noise, adoption-first โ€” critical issues at `error`, context-sensitive at `warn` | All teams on day one |
164
+ | `strict` | All 18 rules at `error` | CI enforcement in mature codebases |
165
+ | `security` | Security rules only | Security-focused scanning |
166
+
167
+ ### ESLint Config (Flat Config)
168
+
169
+ ```javascript
170
+ // eslint.config.mjs
171
+ import aiGuard from 'eslint-plugin-ai-guard';
172
+
173
+ export default [
174
+ {
175
+ plugins: { 'ai-guard': aiGuard },
176
+ rules: { ...aiGuard.configs.recommended.rules },
177
+ },
178
+ ];
179
+ ```
180
+
181
+ ```javascript
182
+ // Strict preset
183
+ export default [
184
+ {
185
+ plugins: { 'ai-guard': aiGuard },
186
+ rules: { ...aiGuard.configs.strict.rules },
187
+ },
188
+ ];
189
+ ```
190
+
191
+ ---
192
+
193
+ ## CI Integration
194
+
195
+ ### GitHub Actions
196
+
197
+ ```yaml
198
+ # .github/workflows/ai-guard.yml
199
+ name: AI Guard
200
+
201
+ on: [pull_request]
202
+
203
+ jobs:
204
+ scan:
205
+ runs-on: ubuntu-latest
206
+ steps:
207
+ - uses: actions/checkout@v4
208
+ - uses: actions/setup-node@v4
209
+ with:
210
+ node-version: 20
211
+ cache: 'npm'
212
+ - run: npm ci
213
+ - run: npx ai-guard run --max-warnings 0
214
+ ```
215
+
216
+ See [`examples/ci/`](./examples/ci/) for more templates (GitLab CI, baseline mode, JSON output).
217
+
218
+ ### Exit Codes
219
+
220
+ | Code | Meaning |
221
+ |------|---------|
222
+ | `0` | No issues (or only warnings below `--max-warnings` threshold) |
223
+ | `1` | Errors found, or warnings exceed `--max-warnings` |
224
+
225
+ ---
226
+
227
+ ## AI Agent Rules
228
+
229
+ Generate instruction files so **Claude Code, Cursor, and GitHub Copilot** automatically avoid the 18 most common AI-generated anti-patterns:
230
+
231
+ ```bash
232
+ npx ai-guard init-context
233
+ ```
234
+
235
+ This writes:
236
+ - `CLAUDE.md` โ€” read automatically by Claude Code
237
+ - `.cursorrules` โ€” read automatically by Cursor
238
+ - `.github/copilot-instructions.md` โ€” read automatically by GitHub Copilot
239
+
240
+ Your AI tools will now avoid these patterns **before** you even run the linter.
241
+
242
+ ---
243
+
244
+ ## Real-World Example
245
+
246
+ ```typescript
247
+ // โŒ Common AI-generated code โ€” 4 issues in one function
248
+ async function processUserOrders(userId: string) {
249
+ const apiKey = 'sk-prod-1234567890abcdef'; // no-hardcoded-secret
250
+
251
+ const orders = await db.query('SELECT * FROM orders WHERE id = ' + userId); // no-sql-string-concat
252
+
253
+ for (const order of orders) {
254
+ await sendEmail(order.email); // no-await-in-loop
255
+ }
256
+
257
+ updateAnalytics(userId); // no-floating-promise
258
+ }
259
+
260
+ // โœ… After ai-guard fixes
261
+ async function processUserOrders(userId: string) {
262
+ const apiKey = process.env.API_KEY;
263
+
264
+ const orders = await db.query('SELECT * FROM orders WHERE id = $1', [userId]);
265
+
266
+ await Promise.all(orders.map(async (order) => sendEmail(order.email)));
267
+
268
+ void updateAnalytics(userId);
269
+ }
270
+ ```
271
+
272
+ ---
273
+
274
+ ## Autofix Support
275
+
276
+ Run autofixes via ESLint:
277
+
278
+ ```bash
279
+ npx eslint src --fix
280
+ ```
281
+
282
+ Rules with autofix:
283
+
284
+ | Rule | Fix |
285
+ |------|-----|
286
+ | `no-hardcoded-secret` | Replaces literal with `process.env.VAR_NAME` |
287
+ | `no-empty-catch` | Inserts `/* TODO: handle error */` |
288
+ | `no-floating-promise` | Marks with `void` |
289
+ | `no-await-in-loop` | Rewrites simple loops to `Promise.all(...)` |
290
+ | `no-async-without-await` | Removes unnecessary `async` keyword |
291
+
292
+ ---
293
+
294
+ ## Philosophy
295
+
296
+ - **Precision over recall** โ€” we'd rather miss a bug than create noise
297
+ - **Low false positives** โ€” if a warning fires too often on valid code, we disable it in `recommended`
298
+ - **Gradual adoption** โ€” `recommended` is the safe default; `strict` is opt-in
299
+ - **Self-validating** โ€” `ai-guard` scans its own source code in CI
300
+
301
+ ---
302
+
303
+ ## Development
304
+
305
+ ```bash
306
+ git clone https://github.com/YashJadhav21/eslint-plugin-ai-guard.git
307
+ cd eslint-plugin-ai-guard
308
+ npm install
309
+ npm run test # Run all 436+ tests
310
+ npm run build # Build CJS + ESM bundles
311
+ npm run typecheck # TypeScript check
312
+ npm run lint:self # Scan own source with ai-guard
313
+ ```
314
+
315
+ ---
316
+
317
+ ## Contributing
318
+
319
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
320
+
321
+ **Rule requests:** Open an issue โ€” describe the AI anti-pattern and why it's common.
322
+
323
+ **False positive reports:** We take these seriously. Open an issue with a minimal code example.
324
+
325
+ See the [Roadmap](ROADMAP.md) for planned features.
326
+
327
+ ---
328
+
329
+ ## License
330
+
331
+ [MIT](LICENSE) โ€” free forever. No rules behind a paywall.
332
+
333
+ ---
334
+
335
+ <p align="center">
336
+ Built to make AI-assisted development safer and more trustworthy. โšก
337
+ </p>