---
title: "lint/strings/no-non-printable-character"
pagination: false
---

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

<RuleId id="lint/strings/no-non-printable-character" />

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

## What it does

Remove Zero-width space (ZWSP), Non-breaking space (NBSP) and other invisible unicode symbols.

## Configuration

```toml title="pun.toml"
[lint.rules]
"strings/no-non-printable-character" = "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.

## Options

| Name | Type | Allowed values | Default | Upstream name |
| --- | --- | --- | --- | --- |
| `use-escape-sequences-in-strings` | `bool` | Any | `true` | `use_escape_sequences_in_strings` |

## Replaces

- [`non_printable_character`](https://cs.symfony.com/doc/rules/basic/non_printable_character.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)
