attr-delimiter
Angular templatesHTMLVue / SvelteVue / Sveltestyleno fixdefault: offhtml/html-validate-recommendedhtml/eslint-plugin-vue-recommended
What it does
Section titled “What it does”Reports white space around the = between an attribute name and its value (class = "a").
Why it matters
Section titled “Why it matters”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 =.
Example
Section titled “Example”...<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>...Configuration
Section titled “Configuration”angular: lint: rules: attr-delimiter: warn # off (default), warn, errorhtml: lint: rules: attr-delimiter: warn # off (default), warn, errorsvelte: lint: rules: attr-delimiter: warn # off (default), warn, errorvue: lint: rules: attr-delimiter: warn # off (default), warn, errorEnabled 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.
Upstream equivalents
Section titled “Upstream equivalents”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 |