# text-escaping

Rule `jsdoc/text-escaping`. Auto-escape certain characters that are input within block and tag descriptions.

- Source: jsdoc
- Technologies: JSDoc
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #2112 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `jsdoc/text-escaping` | no | safe | package `eslint-plugin-jsdoc` | [docs](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/text-escaping.md#repos-sticky-header) |

## Code examples

### Incorrect: the rule reports this

```ts
/**
 * Some things to escape: <a> and &gt; and `test`
 */
```

### Correct: the rule accepts this

```ts
/**
 * Some things to escape: &lt;a> and &gt; and `test`
 */
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import jsdoc from "eslint-plugin-jsdoc";

export default [
  {
    plugins: { jsdoc },
    rules: {
      "jsdoc/text-escaping": "error",
    },
  },
];
```

## Related rules

- [jsdoc/sort-tags](https://lintradar.dev/rules/jsdoc/sort-tags.md): Sorts tags by a specified sequence according to tag name, optionally adding line breaks between tag groups.
- [jsdoc/ts-ban-ts-comment](https://lintradar.dev/rules/jsdoc/ts-ban-ts-comment.md): Disallows (or requires descriptions for) `@ts-<directive>` comments, mirroring `@typescript-eslint/ban-ts-comment`.
- [jsdoc/require-throws](https://lintradar.dev/rules/jsdoc/require-throws.md): Requires that throw statements are documented with `@throws` tags.
- [jsdoc/ts-no-unnecessary-template-expression](https://lintradar.dev/rules/jsdoc/ts-no-unnecessary-template-expression.md): Catches unnecessary template expressions such as string expressions within a template literal.
- [jsdoc/require-template](https://lintradar.dev/rules/jsdoc/require-template.md): Requires `@template` tags be present when type parameters are used.
- [jsdoc/ts-prefer-function-type](https://lintradar.dev/rules/jsdoc/ts-prefer-function-type.md): Prefers function types over call signatures when there are no other properties.

---

Web page: https://lintradar.dev/rules/jsdoc/text-escaping. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
