Skip to content

useVueValidVOn

  • Rule available since: v2.3.6
  • Diagnostic Category: lint/correctness/useVueValidVOn
  • 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": {
"useVueValidVOn": "error"
}
}
}
}

Enforce valid v-on directives with proper arguments, modifiers, and handlers.

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

  • The directive does not have an event name. E.g. <div v-on="foo"></div>
  • The directive has invalid modifiers. E.g. <div v-on:click.bogus="foo"></div>
  • The directive is missing a handler expression. E.g. <div v-on:click></div>
<Foo v-on />
<Foo v-on:click="foo" />