Skip to content

useVueValidVText

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

Enforce valid v-text Vue directives.

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

  • The directive has an argument. E.g. <div v-text:aaa></div>
  • The directive has any modifiers. E.g. <div v-text.bbb></div>
  • The directive does not have a value. E.g. <div v-text></div>
<div v-text />
code-block.vue:1:6 lint/correctness/useVueValidVText ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The v-text directive is missing a value.

> 1 │ <div v-text />
^^^^^^
2 │

v-text directives require a value containing the text content to render.

For example, use v-text=“foo” to render the content of the foo variable.

<div v-text:aaa="foo"></div>
code-block.vue:1:12 lint/correctness/useVueValidVText ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The v-text directive does not accept an argument.

> 1 │ <div v-text:aaa=“foo”></div>
^^^^
2 │

v-text directives should be used without arguments, like v-text=“content”.

<div v-text.bbb="foo"></div>
code-block.vue:1:12 lint/correctness/useVueValidVText ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The v-text directive does not support modifiers.

> 1 │ <div v-text.bbb=“foo”></div>
^^^^
2 │

v-text directives do not support any modifiers. Remove the modifier.

<div v-text="foo" />