Prefer to use <button> instead of <input> for buttons

Rule ID:
prefer-button
Category:
Style
Standards:
-

HTML5 introduces the generic <button> element which replaces <input type="button"> and similar constructs.

The <button> elements has some advantages:

This rule will target the following input types:

Rule details

Examples of incorrect code for this rule:

<input type="button">
error: Prefer to use <button> instead of <input type="button"> when adding buttons (prefer-button) at inline:1:14:
> 1 | <input type="button">
    |              ^^^^^^


1 error found.

Examples of correct code for this rule:

<button type="button"></button>

Options

This rule takes an optional object:

{
  "include": [],
  "exclude": []
}

include

If set only types listed in this array generates errors.

exclude

If set types listed in this array is ignored.