Skip to content

valid-v-pre

Reports a v-pre that has an expression, an argument or a modifier.

The directive takes no value; a value is ignored, so the author believes there is a condition that does not exist.

To fix, write v-pre alone.

Reported
<template>
<div v-if v-bind v-model v-html v-text v-show v-once="x" v-pre="x" v-cloak="x" v-memo v-is />
...
After the fix
<template>
<div v-if v-bind v-model v-html v-text v-show v-once="x" v-pre="x" v-cloak="x" v-memo v-is />
...
angular:
lint:
rules:
valid-v-pre: warn # off, warn (default), error
html:
lint:
rules:
valid-v-pre: warn # off, warn (default), error
svelte:
lint:
rules:
valid-v-pre: warn # off, warn (default), error
vue:
lint:
rules:
valid-v-pre: warn # off, warn (default), error

Enabled by the presets: html/eslint-plugin-vue-recommended.

Suppress one line with sudsy-disable-next-line valid-v-pre in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
eslint-plugin-vue valid-v-pre full