web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.4 KiB

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