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

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

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

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

## What it does

Ordering `use` statements.

## Configuration

```toml title="pun.toml"
[format.rules]
"imports/ordered" = 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 |
| --- | --- | --- | --- | --- |
| `case-sensitive` | `bool` | Any | `false` | `case_sensitive` |
| `order` | `list` | `class`, `function`, `const` | Not set | `imports_order` |
| `sort` | `enum` | `alphabetical`, `length`, `none` | `"alphabetical"` | `sort_algorithm` |

## Replaces

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