From b572cd211ddc11126c4ba11aa374f5451e503471 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Wed, 1 Jul 2026 15:58:58 +0200 Subject: [PATCH] tools: add lint rule for `[await] using` in core Signed-off-by: Renegade334 --- lib/eslint.config_partial.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/eslint.config_partial.mjs b/lib/eslint.config_partial.mjs index 9240b00ac709..cefbfa2f156f 100644 --- a/lib/eslint.config_partial.mjs +++ b/lib/eslint.config_partial.mjs @@ -46,6 +46,11 @@ const noRestrictedSyntax = [ selector: "CallExpression:matches([callee.type='Identifier'][callee.name='FunctionPrototypeApply'], [callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='apply'][arguments.length=2])", message: 'Use `ReflectApply` instead of %Function.prototype.apply%', }, + // TODO: remove once js_explicit_resource_management is unflagged in V8 + { + selector: 'VariableDeclaration[kind=/^(await )?using$/]', + message: '`[await] using` statements cannot yet be used in /lib, call the disposer in a `try ... finally` block instead.', + }, ]; export default [