✅ The extends: 'recommended'
property in a configuration file enables this rule.
🔧 The --fix
option on the command line can automatically fix some of the problems reported by this rule.
This rule requires all <button>
elements to have a valid type
attribute.
By default, the type
attribute of <button>
elements is submit
. This can
be very confusing, when a button component is developed in isolation without
type="button"
, and when inside a <form>
element it suddenly starts to
submit the form.
This rule forbids the following:
This rule allows the following: