vue/html-quotes
enforce quotes style of HTML attributes
- ⚙️ This rule is included in all of
"plugin:vue/strongly-recommended",*.configs["flat/strongly-recommended"],"plugin:vue/vue2-strongly-recommended",*.configs["flat/vue2-strongly-recommended"],"plugin:vue/recommended",*.configs["flat/recommended"],"plugin:vue/vue2-recommended"and*.configs["flat/vue2-recommended"]. - 🔧 The
--fixoption on the command line can automatically fix some of the problems reported by this rule.
You can choose quotes of HTML attributes from:
- Double quotes:
<div class="foo"> - Single quotes:
<div class='foo'> - No quotes:
<div class=foo>
This rule enforces the quotes style of HTML attributes.
📖 Rule Details
This rule reports the quotes of attributes if it is different to configured quotes.
🔧 Options
Default is set to double.
json
{
"vue/html-quotes": [ "error", "double" | "single", { "avoidEscape": false } ]
}String option:
"double"(default) ... requires double quotes."single"... requires single quotes.
Object option:
avoidEscape... Iftrue, allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise.
"single"
"double", { "avoidEscape": true }
📚 Further Reading
🚀 Version
This rule was introduced in eslint-plugin-vue v3.0.0