vue/html-button-has-type
eslint-plugin-vue
No autofix
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/html-button-has-type": "error",
},
},
]; <button>Hello World</button>
<button type="">Hello World</button>
<button type="foo">Hello World</button>
</template><button type="button">Hello World</button>
<button type="submit">Hello World</button>
<button type="reset">Hello World</button>Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
vue/html-button-has-type
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/html-button-has-type": "error",
},
},
];Oxlint does not have this rule.
a11y/useButtonType
a11y · since 1.0.0
{
"linter": {
"rules": {
"a11y": {
"useButtonType": "error"
}
}
}
}Require component name property to match its file name
Disallow constant expressions in conditions in <template>