---
title: "format/imports/single-per-statement"
pagination: false
---

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

<RuleId id="format/imports/single-per-statement" />

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

## What it does

There MUST be one use keyword per declaration.

## Configuration

```toml title="pun.toml"
[format.rules]
"imports/single-per-statement" = 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 |
| --- | --- | --- | --- | --- |
| `group-to-single-imports` | `bool` | Any | `true` | `group_to_single_imports` |

## Replaces

- [`single_import_per_statement`](https://cs.symfony.com/doc/rules/import/single_import_per_statement.html) (php-cs-fixer)
- [`SeparateMultiUseImports`](https://getrector.com/rule-detail/separate-multi-use-imports-rector) (rector)

## Linked rules

- Conflicts with [`format/imports/group`](/docs/rules/format/imports/group). You cannot enable both.

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