> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zenable.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ESLint

> Pluggable linting for JavaScript and TypeScript

## Overview

ESLint is a pluggable static analyzer for JavaScript and TypeScript. Zenable generates an ESLint configuration that enables and configures the rules needed to enforce a requirement, drawing on core rules, plugin rules, and the `no-restricted-syntax` / `no-restricted-imports` selectors for bespoke patterns.

## Capabilities

* Static analysis of JavaScript and TypeScript without running the code
* Enforces code-quality, style, and security rules via core and plugin rules
* Bans specific syntax, APIs, or imports with actionable messages
* Configurable severity per rule (`off` / `warn` / `error`)

## Limitations

* JavaScript and TypeScript only -- check out [Semgrep](/integrations/guardrails/semgrep) or [CodeQL](/integrations/guardrails/codeql) for other languages
* Single-file analysis -- check out [CodeQL](/integrations/guardrails/codeql) for cross-file data-flow analysis
* Not applicable to infrastructure or config files -- check out [Checkov](/integrations/guardrails/checkov) or [Conftest](/integrations/guardrails/conftest)
* Does not test runtime state -- check out [InSpec](/integrations/guardrails/inspec) or [Goss](/integrations/guardrails/goss)

## Generated Format

* **Language:** JSON
* **Structure:** An ESLint configuration object with a `rules` map (and `plugins` when plugin rules are used)
* **Execution:** `eslint --config <config>.json --format json <source>`

## Example Guardrail

```json theme={null}
{
  "rules": {
    "no-restricted-syntax": [
      "error",
      {
        "selector": "CallExpression[callee.name='eval']",
        "message": "eval() is forbidden; it enables code injection."
      }
    ],
    "eqeqeq": "error"
  }
}
```

Learn more at the [ESLint documentation](https://eslint.org/docs/latest/) and the [rules reference](https://eslint.org/docs/latest/rules/).
