---
title: "lint/style/no-useless-sprintf"
pagination: false
---

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

<RuleId id="lint/style/no-useless-sprintf" />

In the [`dead-code`](/docs/rules/sets/dead-code) set. Unsafe fix: it can change behaviour.

## What it does

Remove sprintf() calls with only the format argument.

## Configuration

```toml title="pun.toml"
[lint.rules]
"style/no-useless-sprintf" = "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_sprintf`](https://cs.symfony.com/doc/rules/function_notation/no_useless_sprintf.html) (php-cs-fixer, risky)
- [`UnwrapSprintfOneArgument`](https://getrector.com/rule-detail/unwrap-sprintf-one-argument-rector) (rector)

## Merged rules

These old IDs are now this rule. A config that still names one stops with an error. See [merged rules](/docs/migrate/merged-rules).

- `lint/strings/no-single-argument-sprintf`

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