ESLint v10.0.0-alpha.0 released

We just pushed ESLint v10.0.0-alpha.0, which is a major release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes, so please read the following closely.

Highlights

This version of ESLint is not ready for production use and is provided to gather feedback from the community before releasing the final version. Please let us know if you having any problems or feedback by creating issues on our GitHub repo.

Most of the highlights of this release are breaking changes, and are discussed further in the migration guide. There are summaries of the significant changes below. (Less significant changes are included in the migration guide.)

This prerelease version of ESLint has a separate documentation section.

Node.js < v20.19.0, v21, v23 no longer supported

As of this post, Node.js v22.x is the LTS release, and as such we are dropping support for all versions of Node.js prior to v20.19.0 as well as v21.x and v23.x.

ESLint v10.0.0 supports the following versions of Node.js:

  • Node.js v20.19.0 and above
  • Node.js v22.13.0 and above
  • Node.js v24 and above

New configuration file lookup algorithm

ESLint v10.0.0 locates eslint.config.* by starting from the directory of each linted file rather than the current working directory as it was the case with ESLint v9.x. The new behavior allows for using multiple configuration files in the same run and can be particularly useful in monorepo setups.

In ESLint v9.x, this config lookup behavior could be enabled with the v10_config_lookup_from_file feature flag. In ESLint v10.0.0, this behavior is now the default and the v10_config_lookup_from_file flag has been removed.

Removed eslintrc functionality

As announced in Flat config rollout plans, the eslintrc config system has been completely removed in ESLint v10.0.0. Specifically, this means:

  1. The ESLINT_USE_FLAT_CONFIG environment variable is no longer honored.
  2. The CLI no longer supports eslintrc-specific arguments (--no-eslintrc, --env, --resolve-plugins-relative-to, --rulesdir, --ignore-path).
  3. .eslintrc.* and .eslintignore files will no longer be honored.
  4. /* eslint-env */ comments are reported as errors.
  5. The loadESLint() function now always returns the ESLint class.
  6. The Linter constructor configType argument can only be "flat" and will throw an error if "eslintrc" is passed.
  7. The following Linter eslintrc-specific methods are removed:
    • defineParser()
    • defineRule()
    • defineRules()
    • getRules()
  8. The following changes to the /use-at-your-own-risk entrypoint:
    • LegacyESLint is removed
    • FileEnumerator is removed
    • shouldUseFlatConfig() function will always return true

Jiti < v2.2.0 no longer supported

ESLint v10.0.0 drops support for jiti versions prior to 2.2.0 when loading TypeScript configuration files due to known issues that can cause compatibility problems when configurations load certain plugins.

Updated eslint:recommended

The eslint:recommended configuration is updated to include new rules that we feel are important.

Removed deprecated rule context members

The following rule context members are no longer available:

  • context.getCwd() - Use context.cwd instead
  • context.getFilename() - Use context.filename instead
  • context.getPhysicalFilename() - Use context.physicalFilename instead
  • context.getSourceCode() - Use context.sourceCode instead
  • context.parserOptions - Use context.languageOptions or context.languageOptions.parserOptions instead
  • context.parserPath - No replacement

Users of plugins that haven’t updated their code yet can use the @eslint/compat utility in the meantime.

Removed deprecated LintMessage#nodeType and TestCaseError#type properties

In ESLint v10.0.0, the deprecated nodeType property on LintMessage objects has been removed. Correspondingly, RuleTester no longer accepts the deprecated type property in errors of invalid test cases.

Program AST node range spans entire source text

Starting with ESLint v10.0.0, Program AST node’s range spans the entire source text. Previously, leading and trailing comments/whitespace were not included in the range.

The default parser (espree) has already been updated. Custom parsers are expected to be updated accordingly.

New requirements for ScopeManager implementations

Starting with ESLint v10.0.0, custom ScopeManager implementations must automatically resolve references to global variables declared in the code, including var and function declarations, and provide an instance method addGlobals(names: string[]) that creates variables with the given names in the global scope and resolves references to them.

The default ScopeManager implementation (eslint-scope) has already been updated. Custom ScopeManager implementations are expected to be updated accordingly.

Installing

Since this is a pre-release version, you will not automatically be upgraded by npm. You must specify the next tag when installing:

npm i eslint@next --save-dev

You can also specify the version directly:

npm i eslint@10.0.0-alpha.0 --save-dev

Migration Guide

As there are a lot of changes, we’ve created a migration guide describing the breaking changes in great detail along with the steps you should take to address them. We expect that most users should be able to upgrade without any build changes, but the migration guide should be a useful resource if you encounter problems.

Breaking Changes

Documentation

  • 4b5dbcd docs: reorder v10 migration guide (#20315) (Milos Djermanovic)
  • 5d84a73 docs: Update README (GitHub Actions Bot)
  • 37c8863 docs: fix incorrect anchor link in v10 migration guide (#20299) (Pixel998)
  • 077ff02 docs: add migrate-to-10.0.0 doc (#20143) (唯然)
  • 3822e1b docs: Update README (GitHub Actions Bot)

Chores

  • 1e2cad5 chore: package.json update for @eslint/js release (Jenkins)
  • 9da2679 chore: update @eslint/* dependencies (#20321) (Milos Djermanovic)
  • 0439794 refactor: use types from @eslint/core (#20235) (jaymarvelz)
  • cb51ec2 test: cleanup SourceCode#traverse tests (#20289) (Milos Djermanovic)
  • 897a347 chore: remove restriction for type in rule tests (#20305) (Pixel998)
  • d972098 chore: ignore prettier updates in renovate to keep in sync with trunk (#20304) (Pixel998)
  • a086359 chore: remove redundant fast-glob dev-dependency (#20301) (루밀LuMir)
  • 564b302 chore: install prettier as a dev dependency (#20302) (michael faith)
  • 8257b57 refactor: correct regex for eslint-plugin/report-message-format (#20300) (루밀LuMir)
  • e251671 refactor: extract assertions in RuleTester (#20135) (唯然)
  • 2e7f25e chore: add legacy-peer-deps to .npmrc (#20281) (Milos Djermanovic)
  • 39c638a chore: update eslint-config-eslint dependencies for v10 prereleases (#20278) (Milos Djermanovic)
  • 8533b3f chore: update dependency @eslint/json to ^0.14.0 (#20288) (renovate[bot])
  • 796ddf6 chore: update dependency @eslint/js to ^9.39.1 (#20285) (renovate[bot])

The latest ESLint news, case studies, tutorials, and resources.

ESLint v9.39.1 released
1 min read

ESLint v9.39.1 released

We just pushed ESLint v9.39.1, which is a patch release upgrade of ESLint. This release fixes several bugs found in the previous release.

ESLint v9.39.0 released
2 min read

ESLint v9.39.0 released

We just pushed ESLint v9.39.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release.

ESLint v9.38.0 released
2 min read

ESLint v9.38.0 released

We just pushed ESLint v9.38.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release.