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

⭐️New: Add vue/valid-v-bind-sync rule #647

Merged
merged 20 commits into from Dec 26, 2019
Merged

Conversation

ota-meshi
Copy link
Member

@ota-meshi ota-meshi commented Nov 12, 2018

This PR add vue/valid-v-bind-sync rule. (#639)

vue/valid-v-bind-sync rule reports .sync modifier on v-bind directives in the following cases:

  • The .sync modifier does not have the attribute value which is valid as LHS. E.g. <MyComponent v-bind:aaa.sync="foo() + bar()" />
  • The .sync modifier is on non Vue-components. E.g. <input v-bind:aaa.sync="foo"></div>
  • The .sync modifier's reference is iteration variables. E.g. <div v-for="x in list"><MyComponent v-bind:aaa.sync="x" /></div>

Close #639

@michalsnik michalsnik changed the title New: Add vue/valid-v-bind-sync rule ⭐️New: Add vue/valid-v-bind-sync rule Nov 12, 2018
Copy link
Collaborator

@armano2 armano2 left a comment

Choose a reason for hiding this comment

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

can you add test for:

<template><svg><MyComponent :foo.sync="this.foo().bar" /></svg></template>

lib/rules/valid-v-bind-sync.js Outdated Show resolved Hide resolved
@ota-meshi
Copy link
Member Author

@armano2 Thank you for your review!
I changed it. so please check agein.

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!

@ota-meshi ota-meshi merged commit 6a78831 into master Dec 26, 2019
@ota-meshi ota-meshi deleted the add-rule/valid-v-bind-sync branch December 26, 2019 04:47
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.

Rule Proposal: valid-v-bind-sync
3 participants