---
title: "lint/strings/no-trailing-whitespace-in-string"
pagination: false
---

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

<RuleId id="lint/strings/no-trailing-whitespace-in-string" />

Not in any set. Unsafe fix: it can change behaviour. Intent: suspicious.

## What it does

There must be no trailing whitespace at the end of lines in strings.

## Configuration

```toml title="pun.toml"
[lint.rules]
"strings/no-trailing-whitespace-in-string" = "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_trailing_whitespace_in_string`](https://cs.symfony.com/doc/rules/string_notation/no_trailing_whitespace_in_string.html) (php-cs-fixer, risky)

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