Skip to content

Commit d166023

Browse files
committed
Fix the vue/v-on-handler-style breaking change (vuejs#2538)
1 parent 0fbe35e commit d166023

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/rules/v-on-handler-style.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ module.exports = {
314314
return null
315315
}
316316
const paramCount = methodParamCountMap.get(idCallExpr.callee.name)
317+
// disable the auto-fixed when the node does't have params
318+
if (paramCount == 0) {
319+
return null
320+
}
317321
if (paramCount != null && paramCount > 0) {
318322
// The behavior of target method can change given the arguments.
319323
return null
@@ -368,7 +372,8 @@ module.exports = {
368372
) {
369373
return null
370374
}
371-
if (!isSameParamsAndArgs(idCallExpr)) {
375+
// disable the auto-fixed when the node does't have params
376+
if (node.params.length === 0 || !isSameParamsAndArgs(idCallExpr)) {
372377
// It is not a call with the arguments given as is.
373378
return null
374379
}

0 commit comments

Comments
 (0)