AI Guard: Open-Source ESLint Plugin With 18 Rules Catching AI-Generated Code Smells

Yashhh_21 · reddit · 2026-09-11

A developer released AI Guard (MIT), an ESLint plugin with 18 deterministic rules targeting recurring bad patterns in AI-assisted JS/TS development: floating promises, empty catch blocks, hardcoded secrets, string-concatenated SQL, await-in-loop, and async callbacks in forEach.

It ships as a CLI (npx ai-guard run), a GitHub Action with SARIF output for Code Scanning and inline PR annotations, and an init-context command that generates CLAUDE.md / .cursorrules / copilot-instructions.md so agents learn the rules before writing code.

Design rationale: these are fixed AST patterns, not judgment calls — millisecond deterministic checks in CI beat LLM review on drift and cost. The hard part was precision; the recommended preset is deliberately conservative. The plugin does not detect AI authorship — it catches bad patterns regardless of who wrote them.

Original post →

More from coding & agent

coding & agent channel →