# sort-tags

Rule `jsdoc/sort-tags`. Sorts tags by a specified sequence according to tag name, optionally adding line breaks between tag groups.

- 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: #2111 by reach

## Linters

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

## Code examples

### Incorrect: the rule reports this

```ts
/**\r
 * @param a A\r
 * @example quux(a);\r
 */\r
function quux (a) {}
```

### Correct: the rule accepts this

```ts
/**
 * @param b
 * @param a
 * @returns {string}
 */
function quux () {}
```

Examples from the ESLint documentation.

## Enable it

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

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

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

## Related rules

- [jsdoc/require-throws](https://lintradar.dev/rules/jsdoc/require-throws.md): Requires that throw statements are documented with `@throws` tags.
- [jsdoc/text-escaping](https://lintradar.dev/rules/jsdoc/text-escaping.md): Auto-escape certain characters that are input within block and tag descriptions.
- [jsdoc/require-template](https://lintradar.dev/rules/jsdoc/require-template.md): Requires `@template` tags be present when type parameters are used.
- [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-tags](https://lintradar.dev/rules/jsdoc/require-tags.md): Requires tags be present, optionally for specific contexts
- [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.

---

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