# How does AI Guard relate to ESLint?

Source: https://getaiguard.dev/compare/eslint · Last updated: 2026-11-14 · AI Guard 1.4.7

AI Guard extends ESLint; it does not replace it. `eslint-plugin-ai-guard` is an ESLint plugin, the standard way to add rules and configurations to ESLint, so you add its rules to your existing config alongside ESLint core and typescript-eslint. It also ships a CLI that runs the same rules without your ESLint config, for a quick scan or CI.

## A plugin, in ESLint's own terms

ESLint's documentation describes plugins as the way to "extend ESLint with additional functionality": a plugin can provide rules, named configurations and processors ([ESLint docs: plugins](https://eslint.org/docs/latest/extend/plugins)). AI Guard provides 27 rules and 4 configurations (`recommended`, `strict`, `security`, `agent`):

```javascript
// eslint.config.mjs
import aiGuard from 'eslint-plugin-ai-guard';

export default [
  // …your existing config…
  {
    plugins: { 'ai-guard': aiGuard },
    rules: { ...aiGuard.configs.recommended.rules },
  },
];
```

It works with ESLint 8 or later (flat config and legacy config).

## Where rules overlap

| Pattern | AI Guard | Also available in |
| --- | --- | --- |
| Floating promises | [`no-floating-promise`](https://getaiguard.dev/rules/no-floating-promise) (syntax and scope; uses type information when available) | typescript-eslint `no-floating-promises`, which "requires type information to run" ([docs](https://typescript-eslint.io/rules/no-floating-promises/)) |
| `await` in loops | [`no-await-in-loop`](https://getaiguard.dev/rules/no-await-in-loop) (allows retry and sequential intent; simple loops autofix to `Promise.all`) | ESLint core `no-await-in-loop` ([docs](https://eslint.org/docs/latest/rules/no-await-in-loop)) |
| `eval` | [`no-eval-dynamic`](https://getaiguard.dev/rules/no-eval-dynamic) (only non-literal arguments) | ESLint core `no-eval` ([docs](https://eslint.org/docs/latest/rules/no-eval)) |

Where both exist, choose by what you have: type-aware rules see more but need a full TypeScript program; AI Guard's run without one, in plain JavaScript too. Running both is fine.

Most AI Guard rules have no direct counterpart because they target patterns specific to AI-assisted code: [placeholder implementations](https://getaiguard.dev/rules/no-placeholder-implementation), [tautological assertions](https://getaiguard.dev/rules/no-tautological-assertion), [secrets exposed to the browser](https://getaiguard.dev/rules/no-client-exposed-secret), [undeclared imports](https://getaiguard.dev/rules/no-undeclared-import) and [invisible Unicode](https://getaiguard.dev/rules/no-invisible-unicode).

## Oxlint

The same rules run as an Oxlint JS plugin (`npx ai-guard init-oxlint`). AI Guard's CI lints a fixture set with both linters and fails on any difference; 27 of 27 rules gave identical results ([Results](https://getaiguard.dev/results#oxlint)). Oxlint's JS plugin support is in alpha ([Oxlint docs](https://oxc.rs/docs/guide/usage/linter/js-plugins)).

## Beyond lint

The `ai-guard` CLI adds checks ESLint does not do: `verify` (one verdict for a change), `integrity` (weakened checks), `verify-deps` (packages before install) and agent hooks. These use ESLint internally for the lint part.

## Sources

- [ESLint docs: create plugins](https://eslint.org/docs/latest/extend/plugins)
- [typescript-eslint: no-floating-promises](https://typescript-eslint.io/rules/no-floating-promises/)
- [docs/integrations/oxlint.md](https://github.com/ai-guard-dev/eslint-plugin-ai-guard/blob/main/docs/integrations/oxlint.md)
- [README.md](https://github.com/ai-guard-dev/eslint-plugin-ai-guard#readme)
