---
title: "analyse/dead-code/while-always-true"
pagination: false
---

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

<RuleId id="analyse/dead-code/while-always-true" />

In the [`analyse-recommended`](/docs/rules/presets/analyse-recommended) preset and every stricter one. Report only.

## Configuration

```toml title="pun.toml"
[analyse.rules]
"dead-code/while-always-true" = "on"
```

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

## Replaces

- [`WhileLoopAlwaysTrueConditionRule`](https://phpstan.org/error-identifiers/while.alwaysTrue) (phpstan-classes)
- [`while.alwaysTrue`](https://phpstan.org/error-identifiers/while.alwaysTrue) (phpstan)

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