-
-
Notifications
You must be signed in to change notification settings - Fork 681
⭐️New: Add vue/v-on-parens
rule
#481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hm, my initial thought is there might be two possible rules here:
I'll walk through these in a little more detail.
|
I like the idea behind |
Now that I wanted to update this PR and merge, I think that current implementation is perfectly fine and I'm happy to proceed with it as is. So that we only report methods that don't have any arguments. So if anyone would want to pass argument - he/she can and the rule will not throw any warnings about parantheses being used. For that case we can have separate rule if we'll find it valuable. |
@armano2 @chrisvfritz can you take a look once again? |
@ota-meshi @armano2 I updated this PR, can give it another look? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
A rule that enforces the consistent use of parentheses after method calls — not actually method calls without parentheses, but you get what I mean — in
v-on
directives.'always'
:<button @click="foo()">Foo</button>
'never'
:<button @click="foo">Foo</button>
I think this rule is useful because it enforces consistency (always good) and when set to
'never'
results in smaller output (without unnecessary "function wrapping").The rule includes — based on my tests with real-world projects — reliable fixers.
It does not support the new 2.4.0+
v-on
object syntax because other rules also don't.I'd be happy about feedback on:
v-on-avoid-inline-statements
(that sounds better, but'always'
and'never'
no longer make that much sense)?'recommended'