Skip to content

fix(use-v-on-exact): Reimplement algorithm to catch cases more properly #750

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

Merged
merged 3 commits into from
Jan 5, 2019

Conversation

michalsnik
Copy link
Member

@michalsnik michalsnik commented Jan 4, 2019

Fixes #727

I changed a bit how the rule works and now I'm reporting events only if one of the key modifiers have been used. That prevents reports about cases like @mouseenter="foo" @mouseenter.once="bar".

I also compare all system modifiers chains for given event, and report cases, that have previously been omitted, like:

<button @click.ctrl="foo" @click.ctrl.shift="bar"/>

Additionally I distinct native elements from components, and for components I only compare events that have native modifier. So we'll no longer report this as an error:

<UiButton @click="foo" @click.native="bar"/>

If you have any additional case that come to your mind, please share them.

@michalsnik michalsnik self-assigned this Jan 4, 2019
@michalsnik
Copy link
Member Author

@posva I updated the rule in the last commit, to only consider usage of exact for cases where system modifiers have been used, not keys.

Copy link
Member

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@posva
Copy link
Member

posva commented Jan 5, 2019

I'm not relevant to review the rest but I'm glad I could help!

@michalsnik michalsnik merged commit 5dd07bf into master Jan 5, 2019
@michalsnik michalsnik deleted the fix-use-v-on-exact branch January 5, 2019 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants