---
title: "format/imports/no-unneeded-alias"
pagination: false
---

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

<RuleId id="format/imports/no-unneeded-alias" />

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

## What it does

Imports should not be aliased as the same name.

## Configuration

```toml title="pun.toml"
[format.rules]
"imports/no-unneeded-alias" = true
```

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

## Replaces

- [`no_unneeded_import_alias`](https://cs.symfony.com/doc/rules/import/no_unneeded_import_alias.html) (php-cs-fixer)
- [`RemoveUselessAliasInUseStatement`](https://getrector.com/rule-detail/remove-useless-alias-in-use-statement-rector) (rector)

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