Skip to content

attr-delimiter

Reports white space around the = between an attribute name and its value (class = "a").

The spaces are valid, but few tools and readers expect them, and a line like a = b c = d is hard to split into attributes at a glance.

To fix, write name="value" with nothing around the =.

Reported
...
<html lang="en">
<head><title>x</title></head>
<body>
<P CLASS="a" id = "b" title='c' data-x=d>x</P>
...
<p style="display: none">ok</p>
...
angular:
lint:
rules:
attr-delimiter: warn # off (default), warn, error
html:
lint:
rules:
attr-delimiter: warn # off (default), warn, error
svelte:
lint:
rules:
attr-delimiter: warn # off (default), warn, error
vue:
lint:
rules:
attr-delimiter: warn # off (default), warn, error

Enabled by the presets: html/html-validate-recommended, html/eslint-plugin-vue-recommended.

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

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

Tool Rule Match
eslint-plugin-svelte no-spaces-around-equal-signs-in-attribute full
eslint-plugin-vue no-spaces-around-equal-signs-in-attribute full
html-validate attr-delimiter full