# valid-types

Rule `jsdoc/valid-types`. Requires all types/namepaths to be valid JSDoc, Closure compiler, or TypeScript types (configurable in settings).

- Source: jsdoc
- Technologies: JSDoc
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 8.5M weekly downloads of presets that enable it
- Trend: +22.0% last quarter
- Rank: #1140 by reach, #1385 by growth

## Linters

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

## Code examples

### Incorrect: the rule reports this

```ts
/**
 * @param {Array<string} foo
 */
function quux() {
```

### Correct: the rule accepts this

```ts
/**
 * @param {Array<string>} foo
 */
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/valid-types": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [JSDoc recommended](https://lintradar.dev/presets/jsdoc-recommended.md) | ESLint | `eslint-plugin-jsdoc` | 37 | 8.1M | +23.8% |
| [JSDoc recommended for TypeScript](https://lintradar.dev/presets/jsdoc-recommended-typescript.md) | ESLint | `eslint-plugin-jsdoc` | 34 | 8.1M | +23.8% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |

## Related rules

- [jsdoc/ts-no-empty-object-type](https://lintradar.dev/rules/jsdoc/ts-no-empty-object-type.md): Warns against use of the empty object type
- [jsdoc/tag-lines](https://lintradar.dev/rules/jsdoc/tag-lines.md): Enforces lines (or no lines) before, after, or between tags.
- [jsdoc/require-next-type](https://lintradar.dev/rules/jsdoc/require-next-type.md): Requires a type for `@next` tags
- [jsdoc/require-returns](https://lintradar.dev/rules/jsdoc/require-returns.md): Requires that returns are documented with `@returns`.
- [jsdoc/reject-function-type](https://lintradar.dev/rules/jsdoc/reject-function-type.md): Reports use of `Function` type
- [jsdoc/require-jsdoc](https://lintradar.dev/rules/jsdoc/require-jsdoc.md): Checks for presence of JSDoc comments, on functions and potentially other contexts (optionally limited to exports).

---

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