# ESLint — card for AI agents

Linter that finds and fixes JavaScript code patterns based on AST analysis.

Category: Linting and formatting · npm package `eslint` · latest version 10.14.0 (checked 2026-11-01)
Install: `npm install eslint`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## ESLint
- Put configuration in `eslint.config.js` (or `eslint.config.mjs`) and wrap the exported array in `defineConfig` from `eslint/config`.
- Extend `js/recommended` from `@eslint/js` or turn rules on explicitly. With neither, ESLint lints nothing.
- Use `"warn"` for rules that must not fail the run and `"error"` for rules that should set exit code 1.
- Follow the README's recommendation: pin `eslint` in `package.json` with a tilde (`~`) at the installed version, because minor releases may report more errors.
- Install ESLint, plugins and shareable configs locally as dev dependencies. Do not rely on a global install.
- Under pnpm, add `auto-install-peers=true` and `node-linker=hoisted` to `.npmrc`.
- For React semantics, add `eslint-plugin-react`. JSX parsing alone does not cover React.

## What it is
- ESLint finds and reports problem patterns in JavaScript code. It parses source with Espree, builds an AST, and checks that tree against rules. The README says every rule is a plugin, and you can add more at runtime.
- Configuration lives in `eslint.config.js`. Running `npm init @eslint/config@latest` asks a few questions and writes that file for you. Each rule is set to `"off"`, `"warn"` or `"error"`. Extending `"js/recommended"` from `@eslint/js` turns on the rules marked as recommended.
- The docs state the goal as making code more consistent and avoiding bugs. The site says ESLint is built into most text editors and can run as part of a continuous integration pipeline. You can preprocess code, swap in custom parsers and write your own rules.

## Caveats
- Empty config, empty report: Installing ESLint alone checks nothing. You must extend a shared config such as `js/recommended` or turn rules on yourself.
- Minor versions can add errors: Under ESLint's semver policy, a minor release can report more problems than the last one, for example after a bug fix. The README recommends pinning the version with a tilde (`~`) in `package.json`.
- JSX parsing is not React support: ESLint parses JSX once you enable it in configuration, but it does not understand React's semantics. The README points React users to `eslint-plugin-react`.
- Six months for the previous version: The team gives ongoing support to the current version. The previous version gets six months of limited support, which covers critical bug fixes, security issues and compatibility issues only. The README says commercial support for both current and previous versions is available through Tidelift and HeroDevs.
- Proposals need other parsers: The built-in parser officially supports only the latest final ECMAScript standard. For syntax still at the proposal stage, the README says to use other parsers or plugins, such as `@babel/eslint-parser`.

## Numbers (AgentGid data)
- Gid Score: 86.6 (#22 of all tools, 2 of 83 in its category)
- Used in 2,282 public projects set up for AI coding agents (36.5%)
- Downloads last week: 216,187,244 (as of 2026-11-24), +31.8% over 4 weeks
- GitHub stars: 27,647 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
TypeScript 89.9%, Tailwind CSS 64.5%, React 64.3%, Prettier 45.8%, Next.js 40.9%, Lucide React 42.0%

## Checked alternatives (same job)
- Biome: https://agentgid.com/tools/biomejs/agent.md
- oxlint: https://agentgid.com/tools/oxlint/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/eslint/
- Homepage: https://eslint.org
- Repository: https://github.com/eslint/eslint
- Source: https://github.com/eslint/eslint#readme
- Source: https://github.com/eslint/eslint
- Source: https://github.com/eslint/eslint/releases
- Source: https://eslint.org
- Source: https://eslint.org/docs/latest/use/getting-started#prerequisites


## ESLint: find and fix problems in JavaScript code

ESLint is a free tool that reads JavaScript code and points out likely bugs, such as a misspelled variable or code that never runs. It can fix many simple problems by itself. You or your AI assistant run it before saving or shipping code, so mistakes are caught early.

### Where to use it
- Catch typos before users do: A misspelled variable or a value that is never used gets flagged with its line number before the code reaches your site.
- Fix simple problems automatically: Before a commit, ESLint rewrites what it safely can, like var into let, and lists only what still needs a person.
- Set the house rules once: One settings file in the project turns on the recommended checks and tells ESLint the code runs in a browser, so everyone gets the same warnings.
- Check code typed in a browser: A code playground or lesson page checks what the visitor types right in the page, with no server involved.
- Let an AI assistant run it: ESLint ships a helper server that coding assistants in editors such as VS Code or Cursor can call to check and fix files.
- Gate AI-written code in review: Run ESLint on every change an AI assistant proposes and send the messages back to it until the list is empty. (idea, not from the official pages)

### How to start
- Check Node.js first: ESLint 10 needs ^20.19.0, ^22.13.0 or 24 and newer. Then let the setup command write a config file.

```
npm init @eslint/config@latest
```

- Run it on a file or a folder.

```
npx eslint yourfile.js
```

- Let it fix what it safely can; the rest stays in the report.

```
npx eslint --fix .
```


### License
Free to use in any project, including paid and closed-source ones, under the MIT license. Keep the license notice when you ship its files.

### Good to know
- ESLint 10 runs on Node.js 20.19 or newer (also 22.13+ and 24+). On an older Node, stay on ESLint 9.
- Version 10 dropped the old .eslintrc settings files; only eslint.config.js and its variants work now.
- Out of the box it checks plain JavaScript only. TypeScript and React need extra parsers or plugins.
- It does not know your environment: tell it about browser or Node.js globals, or it reports them as undefined.
- Only the current major version gets full support; the previous one gets six months of critical fixes. Version 9 reached end of life in August 2026.

Checked 2026-11-10 against: https://eslint.org/docs/latest/use/getting-started, https://eslint.org/docs/latest/integrate/nodejs-api, https://eslint.org/docs/latest/use/command-line-interface, https://eslint.org/docs/latest/use/migrate-to-10.0.0, https://eslint.org/docs/latest/use/configure/ignore, https://eslint.org/docs/latest/use/configure/language-options, https://eslint.org/version-support/, https://eslint.org/docs/latest/use/mcp, https://eslint.org/docs/latest/use/configure/configuration-files, https://eslint.org/docs/latest/use/configure/migration-guide, https://eslint.org/docs/latest/rules/, https://github.com/eslint/eslint/blob/main/README.md, https://github.com/eslint/eslint/blob/main/LICENSE, https://registry.npmjs.org/eslint, https://registry.npmjs.org/eslint/10.14.0

### Mistakes to avoid
- Don't: Writing .eslintrc.json or .eslintrc.js with env, extends and plugins as strings → Do: eslint.config.js with defineConfig([...]) from "eslint/config" (ESLint 10 no longer reads the old format; in our run a config object with an env key failed with 'This appears to be in eslintrc format rather than flat config format.')
- Don't: /* eslint-env browser, node */ comments at the top of files → Do: languageOptions: { globals: { ...globals.browser, ...globals.node } } in eslint.config.js (Since 10.0 these comments are errors, not settings.)
- Don't: Running core ESLint on .ts files and expecting it to work → Do: Add typescript-eslint (its parser and configs) to eslint.config.js (The default parser handles plain JavaScript; our run on 'let a: number = 1' gave 'Parsing error: Unexpected token :'.)
- Don't: Silencing 'window is not defined' or 'process is not defined' by turning off no-undef → Do: Declare the runtime's globals (globals.browser or globals.node) in languageOptions (no-undef is what caught the real typo (totl) in our demo; turning it off hides such bugs.)
- Don't: Using ESLint style rules to format code next to Prettier → Do: Let Prettier format and ESLint find problems; keep formatting rules out of the ESLint config (They have different jobs, and overlapping rules fight each other.)

### Questions
- Does ESLint replace Prettier? No. ESLint looks for problem patterns; Prettier formats code. Many projects use both.
- Can it fix everything it reports? No. --fix applies only the fixes rules provide; the rest stays in the report for a person.
- Does it understand JSX? It parses JSX once you enable it in the config; React-specific checks need a React plugin.
- Why are node_modules not checked? node_modules and .git are ignored by default; you can un-ignore folders in the config.
- Can I use it in the browser? The ESLint class needs the file system, so it runs in Node.js only; the Linter class works in a browser bundle.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
