`useButtonType` has a lot of false positive outside forms
Author: lgarronCreated Sep 30, 2026Updated Sep 30, 2026
LabelsA-LinterL-JavaScriptS-Needs discussionL-HTMLS-Needs triage
Environment information
biome 2.5.15
Rule name
useButtonType
Playground link
Expected result
useButtonType doesn't warn outside of forms, where the type="submit" is not an issue.
Whenever I update a project to a recent version of Biome my <buton> elements all develop errors. They are rarely inside forms, so adding type="button" would do nothing for the correctness of the app and just make the page larger for no benefit. I can't think of a single time this issue has helped me avoid a real bug.
I think the only real issue is that such buttons can develop issues if they are associated with forms at a later point. But at that point Biome can error.
I'd like to propose that the rule defaults to only warning for buttons that:
- are inside a
<form>element, or - have a
formassociated via an attribute.
Code of Conduct
- I agree to follow Biome's Code of Conduct
Source: biomejs/biome