---
title: "lint/control-flow/no-useless-return"
pagination: false
---

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

<RuleId id="lint/control-flow/no-useless-return" />

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

## What it does

There should not be an empty `return` statement at the end of a function.

## Configuration

```toml title="pun.toml"
[lint.rules]
"control-flow/no-useless-return" = "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_useless_return`](https://cs.symfony.com/doc/rules/return_notation/no_useless_return.html) (php-cs-fixer)

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