# no-negated-condition

Prefer positive conditions when both branches are present

A negated condition assigns the positive case to the second of two explicit branches.
Instead, you SHOULD remove the negation and exchange the branches.

- Category: style
- Level: warning
- Fix: automatic
- Scope: module

## Reported

```ds title="main.ds"
function status(isReady: boolean): string {
    return !isReady ? "waiting" : "ready";
}
```

## Accepted

```ds title="main.ds"
function status(isReady: boolean): string {
    return isReady ? "ready" : "waiting";
}
```

## Prior art

- [ESLint · no-negated-condition](https://eslint.org/docs/latest/rules/no-negated-condition)

[language/linter/src/rules/style/no_negated_condition.rs:8](https://github.com/destack-sh/destack/blob/main/language/linter/src/rules/style/no_negated_condition.rs#L8)
