Skip to content

Rule · Lint

<button> (or as="button" default) without an explicit type

lint/button-missing-typeinfovoid lintupdated

Why it matters

A button's default type is submit. Decorative or toggle buttons copied from registries (React Bits StarBorder) submit the enclosing form when clicked or when Enter is pressed in a field.

How to fix it

Always set type="button" unless the button submits a form (type="submit").

Example

tsx
<button type="button" onClick={toggle}>Toggle</button>

void lint reports 67 rules in this category. Static source checks with no browser: Tailwind v4 silent failures, Next.js 16 API traps, React render-body bugs, accessibility markup, SEO files and motion hygiene.