Skip to content
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

Fix #614 - Improve errors in valid-v-on, detect forbidden keywords #642

Merged
merged 2 commits into from
Nov 12, 2018

Conversation

michalsnik
Copy link
Member

This PR improves error message pointed in #614. By default if there is no value or one of the two verb modifiers we throw an error, but if someone attempts to use forbidden JS keyword the parser stripes it from AST and we throw the wrong message. Now I'm making sure that the value is really empty, both in the AST and in the code itself, otherwise the rule will throw a message about forbidden value.

context.report({
node,
loc: node.loc,
message: "'v-on' directives require a value or verb modifiers (like 'stop' or 'prevent')."
Copy link
Contributor

Choose a reason for hiding this comment

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

we should not use plural word here, besides of that it looks fine 👍

Suggested change
message: "'v-on' directives require a value or verb modifiers (like 'stop' or 'prevent')."
message: "'v-on' directives require a value or verb modifier (like 'stop' or 'prevent')."

@michalsnik michalsnik self-assigned this Nov 11, 2018
@michalsnik
Copy link
Member Author

@armano2 updated :)

Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

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

@michalsnik LGTM!

@michalsnik michalsnik merged commit dcaccd5 into master Nov 12, 2018
@michalsnik michalsnik deleted the 614-improve-errors-in-valid-v-on branch November 12, 2018 20:04
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.

3 participants