---
title: "lint/style/no-empty"
pagination: false
---

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

<RuleId id="lint/style/no-empty" />

In the [`code-quality`](/docs/rules/sets/code-quality) set. Unsafe fix: it can change behaviour. Intent: suspicious. Upstream gates: `strictRules.disallowedEmpty`.

## What it does

Detects the use of the `empty()` construct.

## Configuration

```toml title="pun.toml"
[lint.rules]
"style/no-empty" = "error"
```

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

## Replaces

- [`DisallowedEmptyRule`](https://github.com/phpstan/phpstan-strict-rules#readme) (phpstan-classes)
- [`no-empty`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#no-empty) (mago-linter)
- [`empty.notAllowed`](https://phpstan.org/error-identifiers/empty.notAllowed) (phpstan-strict-rules)

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