Skip to content

Rule Proposal: use-v-on-exact #271

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

Closed
mysticatea opened this issue Dec 1, 2017 · 4 comments
Closed

Rule Proposal: use-v-on-exact #271

mysticatea opened this issue Dec 1, 2017 · 4 comments

Comments

@mysticatea
Copy link
Member

From #269.

Please describe what the rule should do:

<button @click="select" @click.ctrl="toggle">test</button>

In that case, I think that people expected click triggers the select and ctrl+click triggers the toggle. But actually, the select is triggered by the both cases.

This rule reports v-on directives if multiple v-on directives exist and those have different system modifiers.

Consider to use '.exact' modifier.

What category of rule is this? (place an "X" next to just one item)

[ ] Enforces code style
[X] Warns about a potential error
[X] Suggests an alternate way of doing something
[ ] Other (please specify:)

Provide 2-3 code examples that this rule will warn about:

<!-- ✓ GOOD -->
<button @click="foo"/>
<button @click.ctrl="foo"/>

<!-- ✘ BAD -->
<button @click="foo" @click.ctrl="foo"/>
@michalsnik
Copy link
Member

I like this proposition. Looks like a good heads up rule :)

@chrisvfritz
Copy link
Contributor

I like this rule too! I'm thinking it could even go in essentials and is a candidate for the style guide. @michalsnik Anything you could use from me to make development on this easier?

@michalsnik
Copy link
Member

I think all is clear here and ready to be implemented!

@michalsnik michalsnik self-assigned this Aug 4, 2018
@armano2
Copy link
Contributor

armano2 commented Oct 11, 2018

i can make it but i have question: should this work only for build in events or for all?

armano2 added a commit to armano2/eslint-plugin-vue that referenced this issue Oct 11, 2018
armano2 added a commit to armano2/eslint-plugin-vue that referenced this issue Oct 11, 2018
armano2 added a commit to armano2/eslint-plugin-vue that referenced this issue Oct 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants