# html-button-has-type

Rule `vue/html-button-has-type`. Disallow usage of button without an explicit type attribute

- Source: vue
- Technologies: Vue
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1821 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/html-button-has-type` | no | no | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/html-button-has-type.html) |
| Biome | `a11y/useButtonType` | yes | no | group a11y, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/use-button-type/) |

## Code examples

### Incorrect: the rule reports this

```vue
  <button>Hello World</button>
  <button type="">Hello World</button>
  <button type="foo">Hello World</button>
</template>
```

### Correct: the rule accepts this

```vue
<button type="button">Hello World</button>
<button type="submit">Hello World</button>
<button type="reset">Hello World</button>
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import vue from "eslint-plugin-vue";

export default [
  {
    plugins: { vue },
    rules: {
      "vue/html-button-has-type": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "a11y": {
        "useButtonType": "error"
      }
    }
  }
}
```

## Related rules

- [vue/component-api-style](https://lintradar.dev/rules/vue/component-api-style.md): Enforce component API style
- [vue/match-component-file-name](https://lintradar.dev/rules/vue/match-component-file-name.md): Require component name property to match its file name
- [vue/camelcase](https://lintradar.dev/rules/vue/camelcase.md): Enforce camelcase naming convention in `<template>`
- [vue/no-console](https://lintradar.dev/rules/vue/no-console.md): Disallow the use of `console` in `<template>`
- [vue/block-lang](https://lintradar.dev/rules/vue/block-lang.md): Disallow use other than available `lang`
- [vue/no-constant-condition](https://lintradar.dev/rules/vue/no-constant-condition.md): Disallow constant expressions in conditions in `<template>`

---

Web page: https://lintradar.dev/rules/vue/html-button-has-type. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
