-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusioncoreRelates to ESLint's core APIs and featuresRelates to ESLint's core APIs and featuresnew syntaxThis issue is related to new syntax that has reached stage 4This issue is related to new syntax that has reached stage 4
Description
Syntax name
Explicit Resource Management
Syntax proposal URL
https://github.com/tc39/proposal-explicit-resource-management
Example code
// sync disposal
function * g() {
using handle = acquireFileHandle(); // block-scoped critical resource
} // cleanup
{
using obj = g(); // block-scoped declaration
const r = obj.next();
} // calls finally blocks in `g`
// async disposal
async function * g() {
using stream = acquireStream(); // block-scoped critical resource
...
} // cleanup
{
await using obj = g(); // block-scoped declaration
const r = await obj.next();
} // calls finally blocks in `g`
Implementation Checklist
- Ecma262 update: Add
using
andawait using
Declarations, SuppressedError, DisposableStack, and AsyncDisposableStack tc39/ecma262#3000 - ESTree update: Add ES2026 estree/estree#324
- Acorn update:
using
andawait using
declarations (ES2026) acornjs/acorn#1366 / feat: supportusing
andawait using
acornjs/acorn#1369 -
eslint-visitor-keys
update: Not necessary. -
espree
update: feat: Add support for ES2026using
andawait using
declarations js#658 -
eslint-scope
update: Probably not necessary, but we might want to add a test for it. -
eslint
update:- feat: add
ecmaVersion: 2026
, parsingusing
andawait using
#19832 - rules:
-
astUtils.areBracesNecessary()
feat: support explicit resource management in core rules #19828 -
init-declarations
feat: support explicit resource management ininit-declarations
#19893 -
no-await-in-loop
feat: support explicit resource management in core rules #19828 -
no-const-assign
feat: support explicit resource management inno-const-assign
#19892 -
no-loop-func
feat: support explicit resource management inno-loop-func
#19895 -
no-undef-init
feat: support explicit resource management inno-undef-init
#19894 -
no-unused-vars
feat: support explicit resource management in core rules #19828 -
one-var
feat: support explicit resource management inone-var
#19941 -
prefer-destructuring
feat: support explicit resource management in core rules #19828 -
require-await
feat: support explicit resource management in core rules #19828
-
- feat: add
Participation
- I am willing to submit a pull request for this change.
Additional comments
The specifications can be found at the following link:
tc39/ecma262#3000
https://arai-a.github.io/ecma262-compare/?pr=3000
flipeador, JoshuaKGoldberg, WillAvudim and acidoxee
Metadata
Metadata
Assignees
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusioncoreRelates to ESLint's core APIs and featuresRelates to ESLint's core APIs and featuresnew syntaxThis issue is related to new syntax that has reached stage 4This issue is related to new syntax that has reached stage 4
Type
Projects
Status
Complete