Skip to content

Commit 3b504fa

Browse files
authored
prefer-prototype-methods: Fix argument of isMethodCall (#2247)
1 parent ae84459 commit 3b504fa

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

rules/prefer-prototype-methods.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function create(context) {
3030
// `[].foo.{apply,bind,call}(…)`
3131
// `({}).foo.{apply,bind,call}(…)`
3232
isMethodCall(callExpression, {
33-
names: ['apply', 'bind', 'call'],
33+
methods: ['apply', 'bind', 'call'],
3434
optionalCall: false,
3535
optionalMember: false,
3636
})

test/prefer-prototype-methods.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ test.snapshot({
3333
'foo.bar.bind(bar)',
3434
'foo[{}].call(bar)',
3535
'Object.hasOwn(bar)',
36+
'const foo = [].push.notApply(bar, elements);',
37+
'const push = [].push.notBind(foo)',
38+
'[].forEach.notCall(foo, () => {})',
3639
],
3740
invalid: [
3841
'const foo = [].push.apply(bar, elements);',

0 commit comments

Comments
 (0)