vue/valid-v-for
eslint-plugin-vue
No autofixRecommended
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/valid-v-for": "error",
},
},
]; <div v-for/>
<div v-for:aaa="todo in todos"/>
<div v-for.bbb="todo in todos"/>
<div
v-for="todo in todos"
is="MyComponent"
/>
<MyComponent v-for="todo in todos"/>
<MyComponent
v-for="todo in todos"
:key="foo"
/>
</template> <div v-for="(,a,b) in list" />
<div v-for="(a,,b) in list" />
<div v-for="(a,b,,) in list" />
</template><div v-for="todo in todos"/>
<MyComponent
v-for="todo in todos"
:key="todo.id"
/>
<div
v-for="todo in todos"
:is="MyComponent"
:key="todo.id"
/> <div v-for="(,a,b) in list" />
<div v-for="(a,,b) in list" />
<div v-for="(a,b,,) in list" />
</template>Examples from the ESLint documentation.
vue/valid-v-for
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/valid-v-for": "error",
},
},
];Oxlint does not have this rule.
correctness/useVueValidVFor
correctness · since 2.4.15
{
"linter": {
"rules": {
"correctness": {
"useVueValidVFor": "error"
}
}
}
}