---
title: "lint/pest/prefer-to-equal-with-delta"
pagination: false
---

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

<RuleId id="lint/pest/prefer-to-equal-with-delta" />

In the [`coding-style`](/docs/rules/sets/coding-style) set. Safe fix. Runs when pest is installed.

## What it does

Converts expect(abs($a - $b) &lt; $delta)->toBeTrue() to expect($a)->toEqualWithDelta($b, $delta)

## Configuration

```toml title="pun.toml"
[lint.rules]
"pest/prefer-to-equal-with-delta" = "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

- [`UseToEqualWithDelta`](https://pestphp.com/docs/rector#content-usetoequalwithdeltarector) (pest-plugin-rector)

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