attr-case
Angular templatesHTMLVue / SvelteVue / Sveltestyleno fixdefault: offhtml/html-validate-recommendedhtml/htmlhint
What it does
Section titled “What it does”Reports an attribute name that is not in lowercase (CLASS="a"). Everything inside <svg> and <math> keeps its case and is not reported.
Why it matters
Section titled “Why it matters”HTML reads attribute names without regard to case, so the capitals change nothing for the browser. They only make one file spell the same name two ways, which breaks searches and makes the markup look inconsistent.
To fix, write the name in lowercase.
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-case: warn # off (default), warn, errorhtml: lint: rules: attr-case: warn # off (default), warn, errorsvelte: lint: rules: attr-case: warn # off (default), warn, errorvue: lint: rules: attr-case: warn # off (default), warn, errorEnabled by the presets: html/html-validate-recommended, html/htmlhint.
Suppress one line with sudsy-disable-next-line attr-case in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| html-validate | attr-case |
partial | lowercase only, without the style and ignoreForeign options |
| htmlhint | attr-lowercase |
full |