Skip to content

useVueValidVBind

  • Rule available since: v2.3.6
  • Diagnostic Category: lint/correctness/useVueValidVBind
  • This rule is recommended, meaning it is enabled by default.
  • This rule doesn’t have a fix.
  • The default severity of this rule is error.
  • This rule belongs to the following domains:
  • Sources:
biome.json
{
"linter": {
"rules": {
"correctness": {
"useVueValidVBind": "error"
}
}
}
}

Forbids v-bind directives with missing values or invalid modifiers.

This rule reports v-bind directives in the following cases:

  • The directive has neither a value nor a static argument from which to derive one. E.g. <div v-bind></div> or <div v-bind:[foo]></div>. v-bind:foo and :foo are accepted because they are valid Vue 3.4+ same-name shorthand for :foo="foo".
  • The directive has invalid modifiers. E.g. <div v-bind:aaa.bbb="ccc"></div>
<Foo v-bind />
<div v-bind></div>
<Foo v-bind:foo="foo" />
<Foo :foo />