Skip to content

Fix: allow v-on without attribute values if it has verb modifiers (fixes #49) #50

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 2 commits into from
Jun 27, 2017

Conversation

mysticatea
Copy link
Member

Fixes #49.

This PR fixes false positive of no-invalid-v-on rule.
If a v-on directive has verb modifiers (.stop or .prevent), now that rule allow the directive even if it does not have attribute values.

Copy link
Member

@HerringtonDarkholme HerringtonDarkholme left a comment

Choose a reason for hiding this comment

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

Thanks for your prompt fix!

Copy link
Member

@michalsnik michalsnik left a comment

Choose a reason for hiding this comment

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

LGTM 👍 only one suggestion

@@ -58,7 +62,7 @@ tester.run('no-invalid-v-on', rule, {
{
filename: 'test.vue',
code: '<template><div v-on:click></div></template>',
errors: ["'v-on' directives require that attribute value."]
errors: ["'v-on' directives require that attribute value or verb modifiers."]
Copy link
Member

Choose a reason for hiding this comment

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

Even though @ is a simple alias I think it would be good idea to add more valid test examples with v-on, like e.g.:

<template><div v-on:click.prevent></div></template>
<template><div v-on:click.native.stop></div></template>

Copy link
Member Author

Choose a reason for hiding this comment

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

I added those!

@michalsnik michalsnik added this to the Official release milestone Jun 26, 2017
@michalsnik michalsnik merged commit b0d613c into master Jun 27, 2017
@michalsnik michalsnik deleted the issue49 branch June 27, 2017 11:01
@michalsnik
Copy link
Member

Released in v3.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: allow empty attribute value when event modifier is used
3 participants