vue/no-multiple-objects-in-class
eslint-plugin-vue
No autofix
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-multiple-objects-in-class": "error",
},
},
]; <div :class="[{ foo: isFoo }, { bar: isBar }]" />
</div>
</template><div :class="[{ foo: isFoo, bar: isBar }]" />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-multiple-objects-in-class
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-multiple-objects-in-class": "error",
},
},
];Oxlint does not have this rule.
nursery/noVueMultipleObjectsInClass
nursery · since 2.6.5
{
"linter": {
"rules": {
"nursery": {
"noVueMultipleObjectsInClass": "error"
}
}
}
}Disallow shorthand type conversions in <template>
Disallow constant expressions in conditions in <template>
Disallow usages of ref objects that can lead to loss of reactivity