Skip to content

vue/valid-v-bind-sync ​

enforce valid .sync modifier on v-bind directives

  • 🚫 This rule was deprecated.
  • ⚙️ This rule is included in the following preset configs:
    • *.configs["flat/vue2-essential"]
    • *.configs["flat/vue2-strongly-recommended"]
    • *.configs["flat/vue2-recommended"]
    • "plugin:vue/vue2-essential"
    • "plugin:vue/vue2-strongly-recommended"
    • "plugin:vue/vue2-recommended"

This rule checks whether every .sync modifier on v-bind directives is valid.

📖 Rule Details ​

This rule reports .sync modifier on v-bind directives in the following cases:

  • The .sync modifier does not have an attribute value that is valid as LHS. E.g. <MyComponent v-bind:aaa.sync="foo() + bar()" />, <MyComponent v-bind:aaa.sync="a?.b" />
  • The .sync modifier has potential null object property access. E.g. <MyComponent v-bind:aaa.sync="(a?.b).c" />
  • The .sync modifier is on a non-Vue component. E.g. <input v-bind:aaa.sync="foo"></div>
  • The .sync modifier references an iteration variable. E.g. <div v-for="x in list"><MyComponent v-bind:aaa.sync="x" /></div>
Now loading...

Note

This rule does not check syntax errors in directives because the vue/no-parsing-error rule checks them.

🔧 Options ​

Nothing.

📚 Further Reading ​

🚀 Version ​

This rule was introduced in eslint-plugin-vue v7.0.0

🔍 Implementation ​