---
title: "format/imports/clean-namespace"
pagination: false
---

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

<RuleId id="format/imports/clean-namespace" />

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

## What it does

Namespace must not contain spacing, comments or PHPDoc.

## Configuration

```toml title="pun.toml"
[format.rules]
"imports/clean-namespace" = true
```

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

## Replaces

- [`clean_namespace`](https://cs.symfony.com/doc/rules/namespace_notation/clean_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)
