vue/no-negated-condition
eslint-plugin-vue
No autofix
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-negated-condition": "error",
},
},
];if (!cond) { f();} else { g();}!cond ? 0 : 1if (!cond) { f(); }cond ? 1 : 0if (!cond) { f(); }Examples from the Biome 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-negated-condition
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-negated-condition": "error",
},
},
];Oxlint does not have this rule.
style/noNegationElse
style · since 1.0.0
{
"linter": {
"rules": {
"style": {
"noNegationElse": "error"
}
}
}
}Disallow negated conditions.
Disallow passing multiple objects in an array to class
Disallow shorthand type conversions in <template>
Disallow usages of ref objects that can lead to loss of reactivity