# no-negated-condition

Rule `vue/no-negated-condition`. Disallow negated conditions in `<template>`

- Source: vue
- Technologies: Vue
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1829 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/no-negated-condition` | no | no | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/no-negated-condition.html) |
| Biome | `style/noNegationElse` | no | safe | group style, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/no-negation-else/) |

## Code examples

### Incorrect: the rule reports this

```js
if (!cond) { f();} else { g();}
```

```js
!cond ? 0 : 1
```

### Correct: the rule accepts this

```js
if (!cond) { f(); }
```

```js
cond ? 1 : 0
```

```js
if (!cond) { f(); }
```

Examples from the Biome documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import vue from "eslint-plugin-vue";

export default [
  {
    plugins: { vue },
    rules: {
      "vue/no-negated-condition": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "noNegationElse": "error"
      }
    }
  }
}
```

## Related rules

- [unicorn/no-negated-condition](https://lintradar.dev/rules/unicorn/no-negated-condition.md): Disallow negated conditions.
- [eslint/no-negated-condition](https://lintradar.dev/rules/eslint/no-negated-condition.md): Disallow negated conditions
- [vue/no-multiple-objects-in-class](https://lintradar.dev/rules/vue/no-multiple-objects-in-class.md): Disallow passing multiple objects in an array to class
- [vue/no-negated-v-if-condition](https://lintradar.dev/rules/vue/no-negated-v-if-condition.md): Disallow negated conditions in v-if/v-else
- [vue/no-implicit-coercion](https://lintradar.dev/rules/vue/no-implicit-coercion.md): Disallow shorthand type conversions in `<template>`
- [vue/no-ref-object-reactivity-loss](https://lintradar.dev/rules/vue/no-ref-object-reactivity-loss.md): Disallow usages of ref objects that can lead to loss of reactivity

---

Web page: https://lintradar.dev/rules/vue/no-negated-condition. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
