Skip to content

ESLint

A JavaScript linter that finds and reports problematic code patterns, with rules you can configure.

Stars
27.6k
Forks
5.2k
Licence
MIT
Language
JavaScript
Last update
4 days ago
Type
Dev tool

What it is

ESLint is a tool that scans JavaScript (ECMAScript) code and reports patterns that may be problems or bad practice. It works by parsing code into a syntax tree and checking it against rules, and every rule is a pluggable piece you can turn on, off, or adjust. Developers use it to catch mistakes and keep code style consistent across a project.

  • Run npx eslint on a file or directory to report problems
  • Define rules in an eslint.config.js file and set each to off, warn, or error
  • Use a config setup command (npm init @eslint/config@latest) to start a project configuration
  • Add plugins to check framework-specific patterns, such as eslint-plugin-react for React semantics

Great for

  • JavaScript developers who want automatic checks on their code
  • Teams that want consistent rules enforced in a shared configuration
  • Projects that need to customize which code patterns are flagged
  • Developers working with React who add a React-specific plugin on top

Not ideal for

  • People who only want code formatting; the README says Prettier is the formatter and ESLint is a linter
  • Users of experimental or non-standard syntax without a suitable parser, since ESLint officially supports only the latest final ECMAScript standard
  • Environments that cannot run a supported Node.js version (^20.19.0, ^22.13.0, or >=24)
Step-by-step guide: how to use ESLintInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js ^20.19.0, ^22.13.0, or >=24 (built with SSL and ICU)

    Install and configure ESLint

    npm init @eslint/config@latest

    Run ESLint on a file

    npx eslint yourfile.js
  2. 2

    Run it

    • Make sure Node.js is installed at a supported version
    • Run npm init @eslint/config@latest in your project to create a configuration
    • Run npx eslint yourfile.js on any file or directory
    • Review reported problems and adjust rule levels in eslint.config.js as needed
  3. 3

    Get the most out of it

    • Set individual rules to "warn" or "error" in eslint.config.js to control which problems matter
    • Use the files pattern in the config to apply different rules to different file types
    • Add eslint-plugin-react if you use React and want React-specific checks
    • Pair with Prettier for formatting, as the README recommends using both tools together
    • For pnpm users, the README suggests a .npmrc with auto-install-peers=true and node-linker=hoisted

Downloads

Strengths

  • Highly pluggable: every rule is a plugin and rules can be added at runtime, per the README
  • Mature and widely used, with an MIT license and about 27,600 GitHub stars
  • Clear three-level severity model (off, warn, error) that controls the exit code

Trade-offs

  • Requires a supported Node.js version and, for TypeScript type definitions, TypeScript 5.3 or later
  • Does not lock dependency versions by design, so behavior can change as dependencies update
  • Parser officially supports only the latest final ECMAScript standard; newer experimental syntax may need other parsers

How it compares

ProjectStarsTypeLevelUpdatedBest for
eslint (this)27.6kDev toolintermediate4 days agoJavaScript developers who want automatic checks on their code
typescript-eslint16.5kDev toolintermediate5 days agoJavaScript and TypeScript developers who already use ESLint
prettier52.4kDev toolbeginner4 days agoTeams that want one shared code style without writing their own rules
standard29.4kDev toolbeginner1.3 years agoJavaScript projects where the team wants consistent style without debating rules
lint-staged14.8kDev toolintermediate6 days agoJavaScript or Node.js projects that already use tools like ESLint or Prettier
ruff50.4kCLIbeginner4 days agoPython developers who want one tool for linting and formatting

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.