---
title: "lint/control-flow/prefer-bare-return"
pagination: false
---

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

<RuleId id="lint/control-flow/prefer-bare-return" />

Not in any set. Safe fix.

## What it does

A return statement wishing to return `void` should not return `null`.

## Configuration

```toml title="pun.toml"
[lint.rules]
"control-flow/prefer-bare-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

- [`simplified_null_return`](https://cs.symfony.com/doc/rules/return_notation/simplified_null_return.html) (php-cs-fixer)

## Linked rules

- Conflicts with [`lint/complexity/require-consistent-return`](/docs/rules/lint/complexity/require-consistent-return). You cannot enable both.

[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)
