---
title: "format/operators/increment-style"
pagination: false
---

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

<RuleId id="format/operators/increment-style" />

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

## What it does

Pre- or post-increment and decrement operators should be used if possible.

## Configuration

```toml title="pun.toml"
[format.rules]
"operators/increment-style" = 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 |
| --- | --- | --- | --- | --- |
| `style` | `enum` | `pre`, `post` | `"pre"` | `style` |

## Replaces

- [`increment_style`](https://cs.symfony.com/doc/rules/operator/increment_style.html) (php-cs-fixer)
- [`prefer-pre-increment`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#prefer-pre-increment) (mago-linter)

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