source: frontend/node_modules/eslint-plugin-import/docs/rules/no-deprecated.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.4 KB
Line 
1# import/no-deprecated
2
3<!-- end auto-generated rule header -->
4
5Reports use of a deprecated name, as indicated by a JSDoc block with a `@deprecated`
6tag or TomDoc `Deprecated:` comment.
7
8using a JSDoc `@deprecated` tag:
9
10```js
11// @file: ./answer.js
12
13/**
14 * this is what you get when you trust a mouse talk show
15 * @deprecated need to restart the experiment
16 * @returns {Number} nonsense
17 */
18export function multiply(six, nine) {
19 return 42
20}
21```
22
23will report as such:
24
25```js
26import { multiply } from './answer' // Deprecated: need to restart the experiment
27
28function whatever(y, z) {
29 return multiply(y, z) // Deprecated: need to restart the experiment
30}
31```
32
33or using the TomDoc equivalent:
34
35```js
36// Deprecated: This is what you get when you trust a mouse talk show, need to
37// restart the experiment.
38//
39// Returns a Number nonsense
40export function multiply(six, nine) {
41 return 42
42}
43```
44
45Only JSDoc is enabled by default. Other documentation styles can be enabled with
46the `import/docstyle` setting.
47
48```yaml
49# .eslintrc.yml
50settings:
51 import/docstyle: ['jsdoc', 'tomdoc']
52```
53
54## Worklist
55
56 - [x] report explicit imports on the import node
57 - [x] support namespaces
58 - [x] should bubble up through deep namespaces (#157)
59 - [x] report explicit imports at reference time (at the identifier) similar to namespace
60 - [x] mark module deprecated if file JSDoc has a @deprecated tag?
61 - [ ] don't flag redeclaration of imported, deprecated names
62 - [ ] flag destructuring
Note: See TracBrowser for help on using the repository browser.