---
title: "lint/imports/no-unused"
pagination: false
---

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

<RuleId id="lint/imports/no-unused" />

In the [`dead-code`](/docs/rules/sets/dead-code) set. Safe fix.

## What it does

Unused `use` statements must be removed.

## Configuration

```toml title="pun.toml"
[lint.rules]
"imports/no-unused" = "error"
```

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

## Replaces

- [`no_unused_imports`](https://cs.symfony.com/doc/rules/import/no_unused_imports.html) (php-cs-fixer)
- [`no-redundant-use`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#no-redundant-use) (mago-linter)

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