attribute-boolean-style
What it does
Section titled “What it does”Reports a boolean attribute that is written with a value (disabled="disabled", disabled=""). The attribute is true when it is present.
Why it matters
Section titled “Why it matters”The value of a boolean attribute is not read: muted="false" still mutes. A value that looks like a switch invites that error, and the longer form says nothing more.
To fix, write the attribute alone (disabled). To turn it off, remove it.
Example
Section titled “Example”...<img src="a.png" alt="">...<input type="checkbox" checked="checked" disabled>...<p hidden>x</p>...Configuration
Section titled “Configuration”angular: lint: rules: attribute-boolean-style: warn # off (default), warn, errorhtml: lint: rules: attribute-boolean-style: warn # off (default), warn, errorsvelte: lint: rules: attribute-boolean-style: warn # off (default), warn, errorvue: lint: rules: attribute-boolean-style: warn # off (default), warn, errorEnabled by the presets: html/html-validate-recommended.
Suppress one line with sudsy-disable-next-line attribute-boolean-style 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 | attribute-boolean-style |
partial | the omit style only, without the style option |