Skip to content

Latest commit

 

History

History
77 lines (54 loc) · 1.84 KB

html-quotes.md

File metadata and controls

77 lines (54 loc) · 1.84 KB
pageClass sidebarDepth title description
rule-details
0
vue/html-quotes
enforce quotes style of HTML attributes

vue/html-quotes

enforce quotes style of HTML attributes

  • ⚙️ This rule is included in "plugin:vue/strongly-recommended" and "plugin:vue/recommended".
  • 🔧 The --fix option 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.

<template>
  <!-- ✓ GOOD -->
  <img src="./logo.png">

  <!-- ✗ BAD -->
  <img src='./logo.png'>
  <img src=./logo.png>
</template>

🔧 Options

Default is set to double.

{
  "vue/html-quotes": ["error", "double" | "single"]
}
  • "double" (default) ... requires double quotes.
  • "single" ... requires single quotes.

"single"

<template>
  <!-- ✓ GOOD -->
  <img src='./logo.png'>

  <!-- ✗ BAD -->
  <img src="./logo.png">
  <img src=./logo.png>
</template>

📚 Further reading

🔍 Implementation