# no-restricted-types

Rule `typescript/no-restricted-types`. Disallow certain types

- Source: typescript
- Technologies: TypeScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 2.5M weekly downloads of presets that enable it
- Trend: +97.4% last quarter
- Rank: #1482 by reach, #267 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@typescript-eslint/no-restricted-types` | no | safe | package `@typescript-eslint/eslint-plugin` | [docs](https://typescript-eslint.io/rules/no-restricted-types) |
| Oxlint | `typescript/no-restricted-types` | no | safe | plugin `typescript`, category restriction | [docs](https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-restricted-types.html) |
| Biome | `style/noRestrictedTypes` | no | safe | group style, since 1.9.0 | [docs](https://biomejs.dev/linter/rules/no-restricted-types/) |

## Code examples

### Incorrect: the rule reports this

```ts
let value: Foo;
```

### Correct: the rule accepts this

```ts
let value: Bar;
```

Examples from the Oxlint documentation.

## Enable it

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

```js
import tseslint from "typescript-eslint";

export default [
  {
    plugins: { "@typescript-eslint": tseslint.plugin },
    rules: {
      "@typescript-eslint/no-restricted-types": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "typescript/no-restricted-types": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "noRestrictedTypes": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |

## Related rules

- [typescript/strict-void-return](https://lintradar.dev/rules/typescript/strict-void-return.md): Disallow passing a value-returning function in a position accepting a void function
- [typescript/promise-function-async](https://lintradar.dev/rules/typescript/promise-function-async.md): Require any function or method that returns a Promise to be marked async
- [typescript/non-nullable-type-assertion-style](https://lintradar.dev/rules/typescript/non-nullable-type-assertion-style.md): Enforce non-null assertions over explicit type assertions
- [typescript/naming-convention](https://lintradar.dev/rules/typescript/naming-convention.md): Enforce naming conventions for everything across a codebase
- [typescript/default-param-last](https://lintradar.dev/rules/typescript/default-param-last.md): Enforce default parameters to be last
- [typescript/strict-boolean-expressions](https://lintradar.dev/rules/typescript/strict-boolean-expressions.md): Disallow certain types in boolean expressions

---

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