> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# no-unescaped-entities

[Added in v0.5.0](https://github.com/web-infra-dev/rslint/releases/tag/v0.5.0)
## Configuration

| Preset                            | Configured Value |
| --------------------------------- | ---------------- |
| ✅ reactPlugin.configs.recommended | `"error"`        |


```ts title=rslint.config.ts
import { defineConfig, reactPlugin } from '@rslint/core';

export default defineConfig([
  reactPlugin.configs.recommended,
  {
    rules: {
      'react/no-unescaped-entities': 'error',
    },
  },
]);
```

## Rule Details

Disallow unescaped HTML entities from appearing in markup. Reports occurrences of the characters `>`, `"`, `'`, and `}` in JSX text content and suggests escape sequences as replacements.

Examples of **incorrect** code for this rule:

```jsx
<div> > </div>
<div>Don't</div>
<div>{"foo"}}</div>
```

Examples of **correct** code for this rule:

```jsx
<div> &gt; </div>
<div>Don&apos;t</div>
<div>{"foo"}</div>
<div>{">"}</div>
```

## Options

- `forbid` (default: `[">", "\"", "'", "}"]` with standard alternatives): List of forbidden characters. Each item can be either a string (the character itself) or an object `{ char: string, alternatives: string[] }` specifying replacement suggestions.

```jsonc
{
  "react/no-unescaped-entities": ["error", { "forbid": [">", "}"] }]
}
```

```jsonc
{
  "react/no-unescaped-entities": [
    "error",
    {
      "forbid": [
        { "char": ">", "alternatives": ["&gt;"] },
        { "char": "}", "alternatives": ["&#125;"] }
      ]
    }
  ]
}
```

## Differences from ESLint

TypeScript's JSX parser rejects unescaped `>` and `}` in JSX text with a syntax error before this rule can run, so for TypeScript sources those defaults are effectively enforced by the parser itself. This rule still catches `'`, `"`, and any custom characters configured via `forbid`.

## Original Documentation

- [eslint-plugin-react: no-unescaped-entities](https://github.com/jsx-eslint/eslint-plugin-react/blob/v7.37.5/docs/rules/no-unescaped-entities.md)
- [Source code](https://github.com/jsx-eslint/eslint-plugin-react/blob/v7.37.5/lib/rules/no-unescaped-entities.js)
