---
title: "lint/control-flow/no-superfluous-elseif"
pagination: false
---

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

<RuleId id="lint/control-flow/no-superfluous-elseif" />

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

## What it does

Replaces superfluous `elseif` with `if`.

## Configuration

```toml title="pun.toml"
[lint.rules]
"control-flow/no-superfluous-elseif" = "error"
```

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

## Replaces

- [`no_superfluous_elseif`](https://cs.symfony.com/doc/rules/control_structure/no_superfluous_elseif.html) (php-cs-fixer)

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