---
title: "format/whitespace/no-extra-blank-lines"
pagination: false
---

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

<RuleId id="format/whitespace/no-extra-blank-lines" />

In the [`format-laravel`](/docs/rules/presets/format-laravel) and [`format-psr12`](/docs/rules/presets/format-psr12) presets. Safe fix.

## What it does

Removes extra blank lines and/or blank lines following configuration.

## Configuration

```toml title="pun.toml"
[format.rules]
"whitespace/no-extra-blank-lines" = true
```

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

## Options

| Name | Type | Allowed values | Default | Upstream name |
| --- | --- | --- | --- | --- |
| `tokens` | `list` | `attribute`, `break`, `case`, `comma`, `continue`, `curly-brace-block`, `default`, `extra`, `parenthesis-brace-block`, `return`, `square-brace-block`, `switch`, `throw`, `use`, `use-trait` | `["extra"]` | `tokens` |

## Replaces

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

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