Skip to content

useVueValidVPre

biome.json
{
"linter": {
"rules": {
"correctness": {
"useVueValidVPre": "error"
}
}
}
}

Enforce valid v-pre Vue directives.

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

The directive has an argument so it is invalid.

<div v-pre:arg></div>
code-block.vue:1:11 lint/correctness/useVueValidVPre  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The v-pre directive must not have an argument.

> 1 │ <div v-pre:arg></div>
^^^^
2 │

Use v-pre without arguments, e.g. v-pre.

Unsafe fix: Remove the argument.

1 │ <div·v-pre:arg></div>
----

The directive has a modifier so it is invalid.

<div v-pre.mod></div>
code-block.vue:1:11 lint/correctness/useVueValidVPre  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The v-pre directive does not support modifiers.

> 1 │ <div v-pre.mod></div>
^^^^
2 │

Remove the modifier; v-pre is a stand-alone control directive.

Unsafe fix: Remove the modifier.

1 │ <div·v-pre.mod></div>
----

The directive has a value so it is invalid.

<div v-pre="value"></div>
code-block.vue:1:11 lint/correctness/useVueValidVPre  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The v-pre directive must not have a value.

> 1 │ <div v-pre=“value”></div>
^^^^^^^^
2 │

v-pre is a boolean-like directive and should be used without a value.

Unsafe fix: Remove the value.

1 │ <div·v-pre=value></div>
--------
<div v-pre></div>