Skip to content

Commit 3f448e5

Browse files
committed
tools: add lint rule for [await] using in core
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
1 parent f1e01e7 commit 3f448e5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib/eslint.config_partial.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ const noRestrictedSyntax = [
4646
selector: "CallExpression:matches([callee.type='Identifier'][callee.name='FunctionPrototypeApply'], [callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='apply'][arguments.length=2])",
4747
message: 'Use `ReflectApply` instead of %Function.prototype.apply%',
4848
},
49+
// TODO: remove once js_explicit_resource_management is unflagged in V8
50+
{
51+
selector: "VariableDeclaration:matches([kind='using'], [kind='await using'])",
52+
message: '`[await] using` statements cannot yet be used in /lib, call the disposer in a `try ... finally` block instead.',
53+
},
4954
];
5055

5156
export default [

0 commit comments

Comments
 (0)