---
title: "format/imports/blank-lines-before-namespace"
pagination: false
---

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

<RuleId id="format/imports/blank-lines-before-namespace" />

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

## What it does

Controls blank lines before a namespace declaration.

## Configuration

```toml title="pun.toml"
[format.rules]
"imports/blank-lines-before-namespace" = 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 |
| --- | --- | --- | --- | --- |
| `max-line-breaks` | `int` | Any | `2` | `max_line_breaks` |
| `min-line-breaks` | `int` | Any | `2` | `min_line_breaks` |

## Replaces

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

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