
Highlights
ECMAScript 2026 Explicit Resource Management
ESLint’s default parser espree
now supports new Explicit Resource Management syntax: using
and await using
declarations, which automatically calls a dispose method when a resource goes out of scope.
if (something) {
using someResource = getSomeResource();
// ... use `someResource`
} // dispose `someResource`
async function foo() {
if (something) {
await using someResource = getSomeResource();
// ... use `someResource`
} // await dispose `someResource`
}
To enable parsing this syntax, set languageOptions.ecmaVersion
to 2026
or "latest"
(default).
Please note that the core rules have not yet been updated to support this syntax.
New allowProperties
option in no-restricted-properties
The no-restricted-properties
rule can now be configured to restrict all properties on an object except for specific ones.
/* eslint no-restricted-properties: [2, { "object": "config", "allowProperties": ["settings", "version"] }] */
config.settings = { theme: "dark" }; // ok
config.version = "1.0.0"; // ok
config.apiKey = "12345"; // error
config.timeout = 5000; // error
TypeScript Syntax Support in Core Rules
As announced in the ESLint v9.23.0 release blog post, we are actively working to add TypeScript syntax support to core rules.
ESLint v9.29.0 introduces full TypeScript syntax support for two more core rules. These rules are:
no-restricted-globals
. This rule now ignores references in type annotations.no-var
. This rule now allowsvar
in global type declarations.
These rules can now be used to lint TypeScript files as well as regular JavaScript.
To lint TypeScript code, be sure to use @typescript-eslint/parser
, or another compatible parser.
New SourceCode#isGlobalReference(node)
method
The SourceCode
class has a new method isGlobalReference(node)
.
It returns true
if passed Identifier
node references a global variable configured via languageOptions.globals
, /* global */
comments, or ecmaVersion
, and not declared by a local binding.
const myRule = {
meta: {
// ...
},
create(context) {
return {
Identifier(node) {
if (context.sourceCode.isGlobalReference(node)) {
// do something
}
},
};
},
};
Other notable changes
- New ECMAScript 2025 global variables
Float16Array
andIterator
will now be automatically enabled whenlanguageOptions.ecmaVersion
is set to2025
(or higher) or"latest"
. - The
--prune-suppressions
CLI option will now also remove entries for files that no longer exist. - The
includeIgnoreFile()
helper function now accepts a second optionalname
parameter that allows you to set a custom name for the configuration object this function returns. - The
class-methods-use-this
rule now supports class auto-accessors. This language feature is part of the Decorators proposal, which is still in stage 3 status, but the auto-accessors syntax is already available in TypeScript.
Features
f686fcb
feat: addecmaVersion: 2026
, parsingusing
andawait using
(#19832) (Milos Djermanovic)19cdd22
feat: prune suppressions for non-existent files (#19825) (TKDev7)b3d720f
feat: add ES2025 globals (#19835) (fisker Cheung)677a283
feat: add auto-accessor fields support to class-methods-use-this (#19789) (sethamus)dbba058
feat: allow global type declaration inno-var
(#19714) (Remco Haszing)342bd29
feat: ignore type annotations in no-restricted-globals (#19781) (sethamus)786bcd1
feat: add allowProperties option to no-restricted-properties (#19772) (sethamus)05b66d0
feat: addsourceCode.isGlobalReference(node)
method (#19695) (Nitin Kumar)
Bug Fixes
85c082c
fix: explicit matching behavior with negated patterns and arrays (#19845) (Milos Djermanovic)9bda4a9
fix: fixLintOptions.filterCodeBlock
types (#19837) (ntnyq)7ab77a2
fix: correct breaking deprecation of FlatConfig type (#19826) (Logicer)1ba3318
fix: addlanguage
anddialects
tono-use-before-define
(#19808) (Francesco Trotta)
Documentation
00e3e6a
docs: add support for custom name parameter toincludeIgnoreFile
(#19795) (루밀LuMir)3aed075
docs: Update README (GitHub Actions Bot)a2f888d
docs: enhance documentation with links and fix typos (#19761) (루밀LuMir)53c3235
docs: update to clarify prompt usage (#19748) (Jennifer Davis)
Chores
5c114c9
chore: upgrade @eslint/js@9.29.0 (#19851) (Milos Djermanovic)acf2201
chore: package.json update for @eslint/js release (Jenkins)a806994
refactor: Remove eslintrc from flat config functionality (#19833) (Nicholas C. Zakas)152ed51
test: switch to flat config mode in code path analysis tests (#19824) (Milos Djermanovic)b647239
chore: Update first-party dependencies faster with Renovate (#19822) (Nicholas C. Zakas)7abe42e
refactor: SafeEmitter -> SourceCodeVisitor (#19708) (Nicholas C. Zakas)e392895
perf: improve time complexity ofgetLocFromIndex
(#19782) (루밀LuMir)0ed289c
chore: remove accidentally committed file (#19807) (Francesco Trotta)