---
title: "lint/complexity/prefer-simple-condition"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="lint/complexity/prefer-simple-condition" />

In the [`code-quality`](/docs/rules/sets/code-quality) and [`dead-code`](/docs/rules/sets/dead-code) sets. Safe fix.

## What it does

Simplify a negated comparison or a comparison with a boolean

## Configuration

```toml title="pun.toml"
[lint.rules]
"complexity/prefer-simple-condition" = "error"
```

To skip it in some files or lines, add an [override](/docs/configuration/pun-toml#lint) or an [ignore comment](/docs/configuration/ignore-comments).

## Options

| Name | Type | Allowed values | Default | Upstream name |
| --- | --- | --- | --- | --- |
| `checks` | `list` | `conditions`, `identical-true`, `not-identical` | `["conditions", "identical-true", "not-identical"]` | None (Pun's own) |

## Replaces

- [`BooleanNotIdenticalToNotIdentical`](https://getrector.com/rule-detail/boolean-not-identical-to-not-identical-rector) (rector)
- [`SimplifyBoolIdenticalTrue`](https://getrector.com/rule-detail/simplify-bool-identical-true-rector) (rector)
- [`SimplifyConditions`](https://getrector.com/rule-detail/simplify-conditions-rector) (rector)

## Merged rules

These old IDs are now this rule. A config that still names one stops with an error. See [merged rules](/docs/migrate/merged-rules).

- `lint/complexity/no-negated-comparison`
- `lint/complexity/no-boolean-literal-compare`

[More lint/complexity rules](/docs/rules/lint/complexity) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
