vue/html-quotes
Enforce quotes style of HTML attributes
Default severity: warning
Presets: happy-path, nuxt, ecosystem, opinionated
Automatic fix: Available for supported findings
Applies to: Vue SFC templates and blocks, with script context where the rule requires it
Options: No rule-specific options. Severity and preset selection are configurable.
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({
lint: {
vize: {
"preset": "incremental",
"rules": {
"vue/html-quotes": "warn"
}
},
},
});
vp run lint
Bad
The attributes use single quotes or no quotes instead of the double-quote convention.
<template>
<div class='foo'></div>
<div class=foo></div>
<div v-if='ready'></div>
</template>
Good
Both ordinary attributes and directive expressions use double quotes.
<template>
<div class="foo"></div>
<div v-if="ready"></div>
</template>
Good avoids this rule's finding under the configuration above; other rules may still report diagnostics.