Skip to content

attr-spacing

Reports a quoted attribute value that is directly followed by the next attribute, with no white space between them (class="a"id="b").

Parsers accept it with an error, and many tools read it differently. Two attributes stuck together are hard to read and are usually a missing space from an edit.

To fix, put a space between the attributes.

Reported
...
<head><title>x</title></head>
<body>
...
<a href="x"class="y">t</a>
...
<p style="display: none">ok</p>
...
angular:
lint:
rules:
attr-spacing: warn # off (default), warn, error
html:
lint:
rules:
attr-spacing: warn # off (default), warn, error
svelte:
lint:
rules:
attr-spacing: warn # off (default), warn, error
vue:
lint:
rules:
attr-spacing: warn # off (default), warn, error

Enabled by the presets: html/html-validate-standard.

Suppress one line with sudsy-disable-next-line attr-spacing in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
html-validate attr-spacing full