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

Prevent the use of the v-bind shorthand : on directives #1277

Closed
2 of 4 tasks
peteruithoven opened this issue Aug 14, 2020 · 2 comments
Closed
2 of 4 tasks

Prevent the use of the v-bind shorthand : on directives #1277

peteruithoven opened this issue Aug 14, 2020 · 2 comments

Comments

@peteruithoven
Copy link

Please describe what the rule should do:

Prevent the use of the v-bind shorthand : on directives.

What category should the rule belong to?

  • Enforces code style (layout)
  • Warns about a potential error (problem)
  • Suggests an alternate way of doing something (suggestion)
  • Other (please specify:)

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

<input :v-model="message" >

<div :v-if="show" >Hello</div>

<input type="checkbox" 
  v-for="option of options"
  :key="option.value"
  :v-model="options"
  :value="option.value"
  :label="option.label" >

Additional context

We're using : so frequently it's an easy mistake to add it in front of an directive like v-if or v-model, the issue can be hard to notice. In case of the v-model the value just silently doesn't get updated.

@ota-meshi
Copy link
Member

ota-meshi commented Aug 14, 2020

Thank you for your suggestions.

However, the rule that meet your needs are already implemented in 7.0.0-beta. So I will close this issue.

PR #1191
https://eslint.vuejs.org/rules/no-restricted-v-bind.html

@peteruithoven
Copy link
Author

Awesome! Thanks for working on that merge request.

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

No branches or pull requests

2 participants