diff --git a/rules/prefer-prototype-methods.js b/rules/prefer-prototype-methods.js index 673e86b4ed..e3bdb718a7 100644 --- a/rules/prefer-prototype-methods.js +++ b/rules/prefer-prototype-methods.js @@ -30,7 +30,7 @@ function create(context) { // `[].foo.{apply,bind,call}(…)` // `({}).foo.{apply,bind,call}(…)` isMethodCall(callExpression, { - names: ['apply', 'bind', 'call'], + methods: ['apply', 'bind', 'call'], optionalCall: false, optionalMember: false, }) diff --git a/test/prefer-prototype-methods.mjs b/test/prefer-prototype-methods.mjs index a414a04da2..6dadca6953 100644 --- a/test/prefer-prototype-methods.mjs +++ b/test/prefer-prototype-methods.mjs @@ -33,6 +33,9 @@ test.snapshot({ 'foo.bar.bind(bar)', 'foo[{}].call(bar)', 'Object.hasOwn(bar)', + 'const foo = [].push.notApply(bar, elements);', + 'const push = [].push.notBind(foo)', + '[].forEach.notCall(foo, () => {})', ], invalid: [ 'const foo = [].push.apply(bar, elements);',