You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* WIP: no-deprecation
* I think it's mostly there
* A couple small issues
* Start on docs
* Generated configs and ran tests
* Remove deprecation/deprecation and disable ours as needed
* Remove deprecation/deprecation and disable ours as needed
* updated inline comments
* Fixed up call likes
* Fixed up exports
* The repo is passing now
* lil comment
* Apply suggestions from code review
Co-authored-by: Kirk Waiblinger <kirk.waiblinger@gmail.com>
* Update comments and Related To
* yarn test -u
* Explicitly mention deprecated/deprecated
* no more see
* Throw error for jsDocParsingMode
---------
Co-authored-by: Kirk Waiblinger <kirk.waiblinger@gmail.com>
description: 'Disallow using code marked as `@deprecated`.'
3
+
---
4
+
5
+
importTabsfrom'@theme/Tabs';
6
+
importTabItemfrom'@theme/TabItem';
7
+
8
+
> 🛑 This file is source code, not the primary documentation location! 🛑
9
+
>
10
+
> See **https://typescript-eslint.io/rules/no-deprecated** for documentation.
11
+
12
+
The [JSDoc `@deprecated` tag](https://jsdoc.app/tags-deprecated) can be used to document some piece of code being deprecated.
13
+
It's best to avoid using code marked as deprecated.
14
+
This rule reports on any references to code marked as `@deprecated`.
15
+
16
+
:::note
17
+
[TypeScript recognizes the `@deprecated` tag](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#deprecated) and visualizes deprecated code with a ~strikethrough~.
18
+
However, TypeScript doesn't report type errors for deprecated code on its own.
19
+
:::
20
+
21
+
## Examples
22
+
23
+
<Tabs>
24
+
<TabItemvalue="❌ Incorrect">
25
+
26
+
```ts
27
+
/**@deprecated Use apiV2 instead. */
28
+
declarefunction apiV1():Promise<string>;
29
+
30
+
declarefunction apiV2():Promise<string>;
31
+
32
+
awaitapiV1();
33
+
```
34
+
35
+
```ts
36
+
import { parse } from'node:url';
37
+
38
+
// 'parse' is deprecated. Use the WHATWG URL API instead.
If portions of your project heavily use deprecated APIs and have no plan for moving to non-deprecated ones, you might want to disable this rule in those portions.
65
+
66
+
## Related To
67
+
68
+
-[`import/no-deprecated`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-deprecated.md) and [`import-x/no-deprecated`](https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-deprecated.md): Does not use type information, but does also support [TomDoc](http://tomdoc.org)
69
+
-[`eslint-plugin-deprecation`](https://github.com/gund/eslint-plugin-deprecation) ([`deprecation/deprecation`](https://github.com/gund/eslint-plugin-deprecation?tab=readme-ov-file#rules)): Predecessor to this rule in a separate plugin
0 commit comments