---
title: "format/arrays/trailing-comma-multiline"
pagination: false
---

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

<RuleId id="format/arrays/trailing-comma-multiline" />

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

## What it does

Arguments lists, array destructuring lists, arrays that are multi-line, `match`-lines and parameters lists must have a trailing comma.

## Configuration

```toml title="pun.toml"
[format.rules]
"arrays/trailing-comma-multiline" = 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 |
| --- | --- | --- | --- | --- |
| `after-heredoc` | `bool` | Any | `false` | `after_heredoc` |
| `elements` | `list` | `arguments`, `array-destructuring`, `arrays`, `match`, `parameters` | `["arrays"]` | `elements` |

## Replaces

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

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