vue/no-use-v-else-with-v-for
eslint-plugin-vue
No autofix
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-use-v-else-with-v-for": "error",
},
},
];Disallow using v-else-if/v-else on the same element as v-for
<div v-if="foo">foo</div>
<div v-else-if="bar" v-for="x in xs">{{ x }}</div>
<div v-else v-for="x in xs">{{ x }}</div>
</template><div v-if="foo">foo</div>
<template v-else-if="bar">
<div v-for="x in xs">{{ x }}</div>
</template>
<template v-else>
<div v-for="x in xs">{{ x }}</div>
</template>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/no-use-v-else-with-v-for
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-use-v-else-with-v-for": "error",
},
},
];Oxlint does not have this rule.
correctness/noVueVIfWithVFor
correctness · since 2.3.6
{
"linter": {
"rules": {
"correctness": {
"noVueVIfWithVFor": "error"
}
}
}
}Disallow unnecessary concatenation of literals or template literals in <template>
Disallow target="_blank" attribute without rel="noopener noreferrer"
Enforce Boolean comes first in component prop types