Requires a specific style of attribute quoting
- Rule ID:
- attr-quotes
- Category:
- Style
- Standards:
- -
HTML allows different styles for quoting attributes:
- Single-quote
':<div id='foo'> - Double-quote
":<div id="foo"> - Unquoted:
<div id=foo>(with limitations on allowed content)
This rule unifies which styles are allowed.
Rule details
Examples of incorrect code for this rule:
<p class='foo'></p>
Examples of correct code for this rule:
<p class="foo"></p>
Options
This rule takes an optional object:
{
"style": "auto",
"unquoted": false
}
Style
autorequires usage of double quotes"unless the attribute value contains"(default).singlerequires usage of single quotes'for all attributes.doublerequires usage of double quotes"for all attributes.anyrequires usage of either single quotes'or double quotes"for all attributes.
Unquoted
If false unquoted attributes is disallowed (default).
Version history
- 7.1.0 -
anyadded tostyleoption