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

# ESLint

> How CodeRabbit runs ESLint to lint JavaScript, TypeScript, and framework files on every pull request — including supported plugins, sandboxed execution, and skip conditions.

[ESLint](https://eslint.org/) is a linter for JavaScript, TypeScript, JSX, TSX, CSS, etc. CodeRabbit runs ESLint automatically on every pull request in a secure sandbox, using your repository's own ESLint configuration when present and posting results as inline review comments.

## Files

ESLint will run on `package.json` and files with the following extensions: `.js`, `.ts`, `.cjs`, `.mjs`, `.d.cts`, `.d.mts`, `.jsx`, `.tsx`, `.css`, `.vue`, `.svelte`, `.astro`, `.graphql`, `.gql`, `.mdx`

## Configuration

* ESLint configuration is read from the repository and is used as is. If no applicable ESLint configuration file is found for a changed file, CodeRabbit skips ESLint for that file.
* Please ensure that all ESLint dependencies are defined in your `package.json` file(s).
* Yarn and PNPM workspaces are supported.
* Private ESLint plugins or configurations are not supported at the moment. Please [reach out to support](/support) if you would like us to add support for this.
* For `@typescript-eslint`, linting with type information is not supported at the moment. The [type checking rules](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts) are disabled.
* For `eslint-plugin-import`, the following rules are disabled:
  * `import/no-unresolved`
* For the `eslint-plugin-n`, the following rules are disabled:
  * `n/no-missing-import`
  * `n/no-missing-require`
* For the `eslint-plugin-node`, the following rules are disabled:
  * `node/no-missing-import`
  * `node/no-missing-require`

### Configuration file discovery

CodeRabbit searches the repository recursively for ESLint configuration files. It supports both flat-config and legacy-config filenames:

* Flat config: `eslint.config.js`, `eslint.config.mjs`, `eslint.config.cjs`, `eslint.config.ts`, `eslint.config.mts`, and `eslint.config.cts`
* Legacy config: `.eslintrc`, `.eslintrc.js`, `.eslintrc.cjs`, `.eslintrc.json`, `.eslintrc.yml`, and `.eslintrc.yaml`

For each changed file, CodeRabbit uses the closest discovered ESLint config in that file's directory ancestry. For example, `foo/bar/.eslintrc.js` is automatically used for files under `foo/bar/` and its subdirectories, but not for files outside `foo/bar/`.

CodeRabbit does not use an `eslintConfig` field in `package.json` as a configuration source. Use one of the supported configuration files instead.

To enable or disable ESLint, use your `.coderabbit.yaml` file or the CodeRabbit web UI:

The `e18e.enabled` option controls CodeRabbit-managed `@e18e/eslint-plugin` modernization, performance, and dependency replacement checks. It defaults to `true`. The managed overlay is temporarily disabled at runtime while an installation hotfix is active, so changing this option currently has no effect. When the overlay is active, the Chill profile reports its recommended rules and `e18e/ban-dependencies` as warnings, while the Assertive profile uses the recommended severities and reports `e18e/ban-dependencies` as an error. CodeRabbit does not add the managed overlay when your ESLint configuration already references e18e.

<Tabs>
  <Tab title=".coderabbit.yaml">
    ```yaml .coderabbit.yaml theme={null}
    reviews:
      tools:
        eslint:
          enabled: true
          e18e:
            enabled: true
    ```
  </Tab>

  <Tab title="Web UI">
    Go to **Reviews → Tools → ESLint** in your organization or repository settings and toggle ESLint `on` or `off`.

    ***
  </Tab>
</Tabs>

## Security policy and restrictions

ESLint runs in a sandbox. CodeRabbit scans ESLint config files before any `npm`/`yarn`/`pnpm` installs and only permits a curated allow-list of plugins.

* CodeRabbit extracts referenced plugins from configs (the `plugins` array, `extends: "plugin:..."`, `eslint-plugin-...` mentions).
* If any plugin outside the allow-list is referenced, CodeRabbit skips ESLint for the run.
* CodeRabbit does not install or execute arbitrary third-party plugins from the repository.

The following plugins are currently allowed, grouped by category:

| Category               | Plugins                                                                                                                                                     |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TypeScript / Stylistic | `@typescript-eslint`, `@stylistic`                                                                                                                          |
| Import / Module        | `import`, `simple-import-sort`, `unused-imports`, `n`, `node`                                                                                               |
| React ecosystem        | `react`, `react-hooks`, `react-native`, `jsx-a11y`, `next`                                                                                                  |
| Testing                | `jest`, `vitest`, `testing-library`, `cypress`, `playwright`, `mocha`                                                                                       |
| Frameworks             | `vue`, `nuxt`, `angular`, `@angular-eslint`, `@angular-eslint/template`, `svelte`, `astro`, `solid`, `qwik`, `turbo`, `hydrogen`, `storybook`               |
| Code quality           | `sonarjs`, `security`, `unicorn`, `promise`, `regexp`, `compat`, `jsdoc`, `deprecation`, `lodash`, `boundaries`, `perfectionist`, `eslint-comments`, `e18e` |
| Formatting             | `prettier`, `tailwindcss`                                                                                                                                   |
| Other                  | `mdx`                                                                                                                                                       |

## When CodeRabbit skips ESLint

CodeRabbit will skip running ESLint when:

* The config references a plugin not in the allow-list.
* The config can't be parsed or is otherwise unsafe.
* No `package.json` can be found for the relevant project.

## What's next

<CardGroup cols={1}>
  <Card title="All supported tools" href="/tools/list" icon="list" horizontal>
    Browse the complete list of linters, security analyzers, and CI/CD integrations available in CodeRabbit.
  </Card>

  <Card title="Tools reference" href="/reference/tools-reference" icon="wrench" horizontal>
    Explore detailed specifications and capabilities of all available CodeRabbit tools.
  </Card>

  <Card title="Configuration reference" href="/reference/configuration" icon="settings" horizontal>
    Full reference for all available options, including how to enable, disable, and tune individual tools.
  </Card>
</CardGroup>
