Vize

vue/valid-v-html

Enforce valid v-html directives.

Default severity Presets Automatic fix Options
error essential, happy-path, nuxt, ecosystem, opinionated No None

Applies to: Vue SFC templates and blocks, with script context where the rule requires it.

Bad

v-html lacks its expression or uses an argument/modifier that this directive does not support.

<template>
<div v-html></div>
<div v-html:arg="foo"></div>
<div v-html.mod="foo"></div>
</template>

Good

v-html="html" supplies a valid expression. Syntax validity does not sanitize HTML or make untrusted content safe.

<template>
<div v-html="html"></div>
</template>

Configuration (Vite+)

import { defineConfig } from "@vizejs/vite-plugin/vite-plus";

export default defineConfig({}).withVue({
  linter: {
    "preset": "incremental",
    "rules": {
      "vue/valid-v-html": "error"
    }
  },
});

Then run vp run lint.