ESLint v9.31.0 released

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

Highlights

Explicit resource management support in core rules

Four core rules have been updated to better support explicit resource management, a new feature in ES2026 JavaScript, including support for using and await using syntax.

The init-declarations rule no longer reports on initializing using and await using variables when the option is "never", because these variables must be initialized. For example:

async function foobar() {
 await using quux = getSomething();
}

The no-const-assign rule now reports on modifying using and await using variables. For example:

if (foo) {
 using a = getSomething();
 a = somethingElse;
}

The no-loop-func rule no longer reports on references to using and await using variables, because these variables are constant. For example:

for (using i of foo) {
    var a = function() { return i; }; // OK, all references are referring to block scoped variables in the loop.
    a();
}

The no-undef-init rule no longer reports on using and await using variables initialized to undefined. For example:

using foo = undefined;

Improved RuleTester output for incorrect locations

The run method of the RuleTester class has been enhanced to indicate when multiple properties of a reported error location in a test case do not match. For example:

      AssertionError [ERR_ASSERTION]: Actual error location does not match expected error location.
+ actual - expected

  {
+   column: 31,
+   endColumn: 32
-   column: 32,
-   endColumn: 33
  }

Previously, the output would only show one property even if there were multiple mismatches:

      AssertionError [ERR_ASSERTION]: Error column should be 32

31 !== 32

      + expected - actual

      -31
      +32

Features

Bug Fixes

  • 07fac6c fix: retry on EMFILE when writing autofix results (#19926) (TKDev7)
  • 28cc7ab fix: Remove incorrect RuleContext types (#19910) (Nicholas C. Zakas)

Documentation

  • 664cb44 docs: Update README (GitHub Actions Bot)
  • 40dbe2a docs: fix mismatch between globalIgnores() code and text (#19914) (MaoShizhong)
  • 5a0069d docs: Update README (GitHub Actions Bot)
  • fef04b5 docs: Update working on issues info (#19902) (Nicholas C. Zakas)

Chores

  • 3ddd454 chore: upgrade to @eslint/js@9.31.0 (#19935) (Francesco Trotta)
  • d5054e5 chore: package.json update for @eslint/js release (Jenkins)
  • 0f4a378 chore: update eslint (#19933) (renovate[bot])
  • 76c2340 chore: bump mocha to v11 (#19917) (루밀LuMir)

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

ESLint v9.30.1 released
1 min read

ESLint v9.30.1 released

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

ESLint v9.30.0 released
2 min read

ESLint v9.30.0 released

We just pushed ESLint v9.30.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.29.0 released
3 min read

ESLint v9.29.0 released

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