Prefer to use <button> (prefer-button)

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>


This rule takes an optional object:

  "include": [],
  "exclude": []


If set only types listed in this array generates errors.


If set types listed in this array is ignored.