require-button-type

This rule enforces to use of button element with a valid type attribute.("button", "submit", "reset")

How to use

.eslintrc.js
module.exports = {
  rules: {
    "@html-eslint/require-button-type": "error",
  },
};

Rule Details

Examples of incorrect code for this rule:

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

Examples of correct code for this rule:

<button type="submit"></button>
<button type="button"></button>
<button type="reset"></button>

Further Reading

  1. HTML spec - the button element