vue/no-useless-v-bind
eslint-plugin-vue
Safe autofix
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-useless-v-bind": "error",
},
},
]; <div v-bind:foo="'bar'" />
<div :foo="'bar'" />
</template> <div v-bind:foo="'bar'" />
</template><div foo="bar" />
<div :foo="bar" /><div v-bind:foo="'bar' /* comment */" /> <div v-bind:foo="'bar\nbaz'" />
</template>Examples from the ESLint documentation.
vue/no-useless-v-bind
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-useless-v-bind": "error",
},
},
];Oxlint does not have this rule.
nursery/noVueUselessVBind
nursery · since 2.6.5
{
"linter": {
"rules": {
"nursery": {
"noVueUselessVBind": "error"
}
}
}
}Require or disallow method and property shorthand syntax for object literals in <template>
Require template literals instead of string concatenation in <template>
Disallow literal numbers that lose precision in <template>
Enforce consistent spacing inside array brackets in <template>