Skip to content

Rule Proposal: valid-v-bind-sync #639

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
ota-meshi opened this issue Nov 10, 2018 · 1 comment · Fixed by #647
Closed

Rule Proposal: valid-v-bind-sync #639

ota-meshi opened this issue Nov 10, 2018 · 1 comment · Fixed by #647

Comments

@ota-meshi
Copy link
Member

Please describe what the rule should do:

This rule checks .sync modifier with v-bind.
Most checking of this rule will do the same check as vue/valid-v-model.

Custom Events .sync Modifier

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

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

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

<TheComponent v-bind:title.sync="foo + bar" />
<input v-bind:title.sync="foo"/>
<div v-for="todo in todos">
  <TheComponent v-bind:title.sync="todo" />
</div>

Why should this rule be included?

The .sync modifier behaves similarly to v-model, so the same problem may get into it.

I would like to ask your opinion whether this check should be a separate rule or included in valid-v-bind.

@michalsnik
Copy link
Member

I think we should create separate rule to check this. And if possible reuse some internal logic between these two :)

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

Successfully merging a pull request may close this issue.

2 participants