-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
usingandawait usingDeclarations, SuppressedError, DisposableStack, and AsyncDisposableStack tc39/ecma262#3000 - ESTree update: Add ES2026 estree/estree#324
- Acorn update:
usingandawait usingdeclarations (ES2026) acornjs/acorn#1366 / feat: supportusingandawait usingacornjs/acorn#1369 -
eslint-visitor-keysupdate: Not necessary. -
espreeupdate: feat: Add support for ES2026usingandawait usingdeclarations js#658 -
eslint-scopeupdate: Probably not necessary, but we might want to add a test for it. -
eslintupdate:- feat: add
ecmaVersion: 2026, parsingusingandawait using#19832 - rules:
-
astUtils.areBracesNecessary()feat: support explicit resource management in core rules #19828 -
init-declarationsfeat: support explicit resource management ininit-declarations#19893 -
no-await-in-loopfeat: support explicit resource management in core rules #19828 -
no-const-assignfeat: support explicit resource management inno-const-assign#19892 -
no-loop-funcfeat: support explicit resource management inno-loop-func#19895 -
no-undef-initfeat: support explicit resource management inno-undef-init#19894 -
no-unused-varsfeat: support explicit resource management in core rules #19828 -
one-varfeat: support explicit resource management inone-var#19941 -
prefer-destructuringfeat: support explicit resource management in core rules #19828 -
require-awaitfeat: 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