---
title: "format/types/union-spacing"
pagination: false
---

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

<RuleId id="format/types/union-spacing" />

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

## What it does

A single space or none should be around union type and intersection type operators.

## Configuration

```toml title="pun.toml"
[format.rules]
"types/union-spacing" = true
```

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

## Options

| Name | Type | Allowed values | Default | Upstream name |
| --- | --- | --- | --- | --- |
| `space` | `enum` | `none`, `single` | `"none"` | `space` |
| `space-multiple-catch` | `enum` | `none`, `single` | `"same-as-space"` | `space_multiple_catch` |

## Replaces

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

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