valid-v-once
Angular templatesHTMLVue / SvelteVue / Sveltecorrectnessno fixdefault: warnhtml/eslint-plugin-vue-recommended
What it does
Section titled “What it does”Reports a v-once that has an expression, an argument or a modifier.
Why it matters
Section titled “Why it matters”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-once alone.
Example
Section titled “Example”<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 />...<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 />...Configuration
Section titled “Configuration”angular: lint: rules: valid-v-once: warn # off, warn (default), errorhtml: lint: rules: valid-v-once: warn # off, warn (default), errorsvelte: lint: rules: valid-v-once: warn # off, warn (default), errorvue: lint: rules: valid-v-once: warn # off, warn (default), errorEnabled by the presets: html/eslint-plugin-vue-recommended.
Suppress one line with sudsy-disable-next-line valid-v-once in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| eslint-plugin-vue | valid-v-once |
full |