prefer-button
What it does
Section titled “What it does”Reports <input type="button">, type="submit", type="reset" and type="image".
Why it matters
Section titled “Why it matters”A <button> can hold markup (an icon with text) and is styled like any other element; an <input> button shows only its value and has fewer ways to style.
To fix, use a <button> with the same type.
Example
Section titled “Example”...<button type="button">Go</button>...<input type="text" name="b"><input type="submit" value="Go">...<video controls></video></body>...Configuration
Section titled “Configuration”angular: lint: rules: prefer-button: warn # off (default), warn, errorhtml: lint: rules: prefer-button: warn # off (default), warn, errorsvelte: lint: rules: prefer-button: warn # off (default), warn, errorvue: lint: rules: prefer-button: warn # off (default), warn, errorEnabled by the presets: html/html-validate-recommended.
Suppress one line with sudsy-disable-next-line prefer-button 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 |
|---|---|---|
| html-validate | prefer-button |
full |