Skip to content

Commit

Permalink
Fix the vue/v-on-handler-style breaking change (vuejs#2538)
Browse files Browse the repository at this point in the history
  • Loading branch information
heggria committed Aug 29, 2024
1 parent 0fbe35e commit d166023
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/rules/v-on-handler-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ module.exports = {
return null
}
const paramCount = methodParamCountMap.get(idCallExpr.callee.name)
// disable the auto-fixed when the node does't have params
if (paramCount == 0) {
return null
}
if (paramCount != null && paramCount > 0) {
// The behavior of target method can change given the arguments.
return null
Expand Down Expand Up @@ -368,7 +372,8 @@ module.exports = {
) {
return null
}
if (!isSameParamsAndArgs(idCallExpr)) {
// disable the auto-fixed when the node does't have params
if (node.params.length === 0 || !isSameParamsAndArgs(idCallExpr)) {
// It is not a call with the arguments given as is.
return null
}
Expand Down

0 comments on commit d166023

Please sign in to comment.