---
title: "lint/pest/prefer-separate-expects"
pagination: false
---

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

<RuleId id="lint/pest/prefer-separate-expects" />

Not in any preset. Needs the [`pest` extension](/docs/configuration/pun-toml#extensions). Safe fix.

## What it does

Splits `->and()` calls in expect() chains into separate expect() statements

## Configuration

```toml title="pun.toml"
[lint.rules]
"pest/prefer-separate-expects" = "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).

## Replaces

- [`ConvertAndToExpect`](https://getrector.com/find-rule) (pest-plugin-rector)

## Linked rules

- Conflicts with [`lint/pest/prefer-chained-expect`](/docs/rules/lint/pest/prefer-chained-expect). You cannot enable both.

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