Rules
no-missing-button-type
Full Name in eslint-plugin-react-dom
Full Name in @eslint-react/eslint-plugin
Features
🔍
Presets
dom
recommended
recommended-typescript
recommended-type-checked
What it does
Enforces explicit type
attribute for button
elements.
The default type
of a button is submit
, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit
, button
or reset
.
Examples
Failing
Passing
Implementation
Further Reading
See Also
no-missing-iframe-sandbox
Enforces explicitsandbox
attribute foriframe
elements.