Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

noDefaults.js 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc"));
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. var _default = (0, _iterateJsdoc.default)(({
  9. context,
  10. utils
  11. }) => {
  12. const {
  13. noOptionalParamNames
  14. } = context.options[0] || {};
  15. const paramTags = utils.getPresentTags(['param', 'arg', 'argument']);
  16. paramTags.forEach(tag => {
  17. if (noOptionalParamNames && tag.optional) {
  18. utils.reportJSDoc(`Optional param names are not permitted on @${tag.tag}.`, tag, () => {
  19. utils.changeTag(tag, {
  20. name: tag.name.replace(/([^=]*)(=.+)?/, '$1')
  21. });
  22. });
  23. } else if (tag.default) {
  24. utils.reportJSDoc(`Defaults are not permitted on @${tag.tag}.`, tag, () => {
  25. utils.changeTag(tag, {
  26. name: tag.name.replace(/([^=]*)(=.+)?/, '[$1]')
  27. });
  28. });
  29. }
  30. });
  31. const defaultTags = utils.getPresentTags(['default', 'defaultvalue']);
  32. defaultTags.forEach(tag => {
  33. if (tag.description.trim()) {
  34. utils.reportJSDoc(`Default values are not permitted on @${tag.tag}.`, tag, () => {
  35. utils.changeTag(tag, {
  36. description: '',
  37. postTag: ''
  38. });
  39. });
  40. }
  41. });
  42. }, {
  43. contextDefaults: true,
  44. meta: {
  45. docs: {
  46. description: 'This rule reports defaults being used on the relevant portion of `@param` or `@default`.',
  47. url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-defaults'
  48. },
  49. fixable: 'code',
  50. schema: [{
  51. additionalProperties: false,
  52. properties: {
  53. contexts: {
  54. items: {
  55. anyOf: [{
  56. type: 'string'
  57. }, {
  58. additionalProperties: false,
  59. properties: {
  60. comment: {
  61. type: 'string'
  62. },
  63. context: {
  64. type: 'string'
  65. }
  66. },
  67. type: 'object'
  68. }]
  69. },
  70. type: 'array'
  71. },
  72. noOptionalParamNames: {
  73. type: 'boolean'
  74. }
  75. },
  76. type: 'object'
  77. }],
  78. type: 'suggestion'
  79. }
  80. });
  81. exports.default = _default;
  82. module.exports = exports.default;
  83. //# sourceMappingURL=noDefaults.js.map