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 [