---
title: "format/imports/group"
pagination: false
---

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

<RuleId id="format/imports/group" />

Not in any preset. Safe fix.

## What it does

There MUST be group use for the same namespaces.

## Configuration

```toml title="pun.toml"
[format.rules]
"imports/group" = 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-types` | `list` | `classy`, `functions`, `constants` | `["classy", "functions", "constants"]` | `group_types` |

## Replaces

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

## Linked rules

- Conflicts with [`format/imports/single-per-statement`](/docs/rules/format/imports/single-per-statement). 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)
