Commit ae8312791da for nodejs

commit ae8312791da0b11e2f91f123bce9bf560fc0e401
Author: LiviaMedeiros <livia@cirno.name>
Date:   Wed Nov 18 21:59:59 2026 +0800

    tools: restrict defining `Symbol.[Async]Dispose` functions as aliases

    Signed-off-by: LiviaMedeiros <livia@cirno.name>
    PR-URL: https://github.com/nodejs/node/pull/67582
    Refs: https://github.com/nodejs/node/blob/HEAD/doc/contributing/erm-guidelines.md#debuggability-of-disposer-methods
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

diff --git a/lib/eslint.config_partial.mjs b/lib/eslint.config_partial.mjs
index 41873397ba4..bebcd25fb3d 100644
--- a/lib/eslint.config_partial.mjs
+++ b/lib/eslint.config_partial.mjs
@@ -46,6 +46,16 @@ 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%',
   },
+  {
+    selector: "Property[computed=true][key.name=/^SymbolDispose$/]:not([value.type=/^(Arrow)?FunctionExpression$/]):not([value.callee.name='assignFunctionName'][value.arguments.1.type=/^(Arrow)?FunctionExpression$/])," +
+      "AssignmentExpression[left.computed=true][left.property.name=/^SymbolDispose$/]:not([right.type=/^(Arrow)?FunctionExpression$/]):not([right.callee.name='assignFunctionName'][right.arguments.1.type=/^(Arrow)?FunctionExpression$/])",
+    message: 'Symbol.dispose functions should not be direct aliases, use inline function instead.',
+  },
+  {
+    selector: "Property[computed=true][key.name=/^SymbolAsyncDispose$/]:not([value.type=/^(Arrow)?FunctionExpression$/]):not([value.callee.name='assignFunctionName'][value.arguments.1.type=/^(Arrow)?FunctionExpression$/])," +
+      "AssignmentExpression[left.computed=true][left.property.name=/^SymbolAsyncDispose$/]:not([right.type=/^(Arrow)?FunctionExpression$/]):not([right.callee.name='assignFunctionName'][right.arguments.1.type=/^(Arrow)?FunctionExpression$/])",
+    message: 'Symbol.asyncDispose functions should not be direct aliases, use inline function instead.',
+  },
 ];

 export default [