jsdoc.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. 'use strict';
  2. module.exports = {
  3. plugins: [ 'jsdoc' ],
  4. settings: {
  5. jsdoc: { tagNamePreference: { returns: 'return' } },
  6. },
  7. rules: {
  8. /**
  9. * Ensures that (JavaScript) examples within JSDoc adhere to ESLint rules.
  10. * @see https://github.com/gajus/eslint-plugin-jsdoc#check-examples
  11. */
  12. 'jsdoc/check-examples': 'off',
  13. /**
  14. * Ensures that parameter names in JSDoc match those in the function declaration.
  15. * @see https://github.com/gajus/eslint-plugin-jsdoc#check-param-names
  16. */
  17. 'jsdoc/check-param-names': 1,
  18. /**
  19. * Reports invalid block tag names.
  20. * @see https://github.com/gajus/eslint-plugin-jsdoc#check-tag-names
  21. */
  22. 'jsdoc/check-tag-names': 1,
  23. /**
  24. * Reports invalid types.
  25. * @see https://github.com/gajus/eslint-plugin-jsdoc#check-types
  26. */
  27. 'jsdoc/check-types': 'off',
  28. /**
  29. * Enforces a consistent padding of the block description.
  30. * @see https://github.com/gajus/eslint-plugin-jsdoc#newline-after-description
  31. */
  32. 'jsdoc/newline-after-description': 'off',
  33. /**
  34. * Checks that types in jsdoc comments are defined. This can be used to check unimported types.
  35. * @see https://github.com/gajus/eslint-plugin-jsdoc#no-undefined-types
  36. */
  37. 'jsdoc/no-undefined-types': 'off',
  38. /**
  39. * Requires that all functions have a description.
  40. * @see https://github.com/gajus/eslint-plugin-jsdoc#require-description
  41. */
  42. 'jsdoc/require-description': 'off',
  43. /**
  44. * Requires that block description and tag description are written in complete sentences
  45. * @see https://github.com/gajus/eslint-plugin-jsdoc#require-description-complete-sentence
  46. */
  47. 'jsdoc/require-description-complete-sentence': 'off',
  48. /**
  49. * Requires that all functions have examples.
  50. * @see https://github.com/gajus/eslint-plugin-jsdoc#require-example
  51. */
  52. 'jsdoc/require-example': 'off',
  53. /**
  54. * Requires a hyphen before the @param description.
  55. * @see https://github.com/gajus/eslint-plugin-jsdoc#require-hyphen-before-param-description
  56. */
  57. 'jsdoc/require-hyphen-before-param-description': 'off',
  58. /**
  59. * Requires that all function parameters are documented.
  60. * @see https://github.com/gajus/eslint-plugin-jsdoc#require-param
  61. */
  62. 'jsdoc/require-param': 1,
  63. /**
  64. * Requires that @param tag has description value.
  65. * @see https://github.com/gajus/eslint-plugin-jsdoc#require-param-description
  66. */
  67. 'jsdoc/require-param-description': 1,
  68. /**
  69. * Requires that all function parameters have name.
  70. * @see https://github.com/gajus/eslint-plugin-jsdoc#require-param-name
  71. */
  72. 'jsdoc/require-param-name': 1,
  73. /**
  74. * Requires that @param tag has type value.
  75. * @see https://github.com/gajus/eslint-plugin-jsdoc#require-param-type
  76. */
  77. 'jsdoc/require-param-type': 1,
  78. /**
  79. * Requires returns are documented.
  80. * @see https://github.com/gajus/eslint-plugin-jsdoc#require-returns
  81. */
  82. 'jsdoc/require-returns': 'off',
  83. /**
  84. * Checks if the return expression exists in function body and in the comment.
  85. * @see https://github.com/gajus/eslint-plugin-jsdoc#require-returns-check
  86. */
  87. 'jsdoc/require-returns-check': 1,
  88. /**
  89. * Requires that @returns tag has description value.
  90. * @see https://github.com/gajus/eslint-plugin-jsdoc#require-returns-description
  91. */
  92. 'jsdoc/require-returns-description': 1,
  93. /**
  94. * Requires that @returns tag has type value.
  95. * @see https://github.com/gajus/eslint-plugin-jsdoc#require-returns-type
  96. */
  97. 'jsdoc/require-returns-type': 1,
  98. /**
  99. * Requires all types to be valid JSDoc or Closure compiler types without syntax errors.
  100. * @see https://github.com/gajus/eslint-plugin-jsdoc#valid-types
  101. */
  102. 'jsdoc/valid-types': 'off',
  103. },
  104. };