# no-deprecated

Rule `typescript/no-deprecated`. Disallow using code marked as `@deprecated`

- Source: typescript
- Technologies: TypeScript
- Kind: suspicious
- Needs type information: yes
- Autofix: no
- Reach: 46.6M weekly downloads of presets that enable it
- Trend: +31.9% last quarter
- Rank: #279 by reach, #1105 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@typescript-eslint/no-deprecated` | no | no | package `@typescript-eslint/eslint-plugin` | [docs](https://typescript-eslint.io/rules/no-deprecated) |
| Oxlint | `typescript/no-deprecated` | no | no | plugin `typescript`, category pedantic | [docs](https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-deprecated.html) |
| Biome | `suspicious/noDeprecatedImports` | no | no | group suspicious, since 2.2.5 | [docs](https://biomejs.dev/linter/rules/no-deprecated-imports/) |

## Code examples

### Incorrect: the rule reports this

```ts
/** @deprecated Use apiV2 instead. */
declare function apiV1(): Promise<string>;

declare function apiV2(): Promise<string>;

await apiV1();
```

```ts
import { parse } from 'node:url';

// 'parse' is deprecated. Use the WHATWG URL API instead.
const url = parse('/foo');
```

### Correct: the rule accepts this

```ts
/** @deprecated Use apiV2 instead. */
declare function apiV1(): Promise<string>;

declare function apiV2(): Promise<string>;

await apiV2();
```

```ts
// Modern Node.js API, uses `new URL()`
const url2 = new URL('/foo', 'http://www.example.com');
```

Examples from the ESLint documentation.

## Enable it

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

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

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

### Oxlint: `.oxlintrc.json`

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

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "suspicious": {
        "noDeprecatedImports": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [typescript-eslint strict type-checked](https://lintradar.dev/presets/typescript-eslint-strict-type-checked.md) | ESLint | `@typescript-eslint/eslint-plugin` | 75 | 175.9M | +29.5% |
| [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% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [react/no-deprecated](https://lintradar.dev/rules/react/no-deprecated.md): Disallow usage of deprecated methods
- [import/no-deprecated](https://lintradar.dev/rules/import/no-deprecated.md): Forbid imported names marked with `@deprecated` documentation tag.
- [typescript/consistent-indexed-object-style](https://lintradar.dev/rules/typescript/consistent-indexed-object-style.md): Require or disallow the `Record` type
- [typescript/no-unnecessary-type-conversion](https://lintradar.dev/rules/typescript/no-unnecessary-type-conversion.md): Disallow conversion idioms when they do not change the type or value of the expression
- [typescript/no-unsafe-member-access](https://lintradar.dev/rules/typescript/no-unsafe-member-access.md): Disallow member access on a value with type `any`
- [typescript/ban-tslint-comment](https://lintradar.dev/rules/typescript/ban-tslint-comment.md): Disallow `// tslint:<rule-flag>` comments

---

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