---
title: "lint/complexity/no-negated-group"
pagination: false
---

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

<RuleId id="lint/complexity/no-negated-group" />

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

## What it does

Simplify negated conditions with de Morgan theorem

## Configuration

```toml title="pun.toml"
[lint.rules]
"complexity/no-negated-group" = "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` | `ands`, `de-morgan` | `["ands", "de-morgan"]` | None (Pun's own) |

## Replaces

- [`NegatedAndsToPositiveOrs`](https://getrector.com/rule-detail/negated-ands-to-positive-ors-rector) (rector)
- [`SimplifyDeMorganBinary`](https://getrector.com/rule-detail/simplify-de-morgan-binary-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-and`

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