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.

noRestrictedSyntax.js 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. info: {
  11. selector,
  12. comment
  13. },
  14. report
  15. }) => {
  16. var _foundContext$context, _foundContext$message;
  17. if (!context.options.length) {
  18. report('Rule `no-restricted-syntax` is missing a `context` option.');
  19. return;
  20. }
  21. const {
  22. contexts
  23. } = context.options[0];
  24. const foundContext = contexts.find(cntxt => {
  25. return cntxt === selector || typeof cntxt === 'object' && (!cntxt.context || cntxt.context === 'any' || selector === cntxt.context) && comment === cntxt.comment;
  26. });
  27. const contextStr = typeof foundContext === 'object' ? (_foundContext$context = foundContext.context) !== null && _foundContext$context !== void 0 ? _foundContext$context : 'any' : foundContext;
  28. const message = (_foundContext$message = foundContext === null || foundContext === void 0 ? void 0 : foundContext.message) !== null && _foundContext$message !== void 0 ? _foundContext$message : 'Syntax is restricted: {{context}}.';
  29. report(message, null, null, {
  30. context: contextStr
  31. });
  32. }, {
  33. contextSelected: true,
  34. meta: {
  35. docs: {
  36. description: 'Reports when certain comment structures are present.',
  37. url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-restricted-syntax'
  38. },
  39. fixable: 'code',
  40. schema: [{
  41. additionalProperties: false,
  42. properties: {
  43. contexts: {
  44. items: {
  45. anyOf: [{
  46. type: 'string'
  47. }, {
  48. additionalProperties: false,
  49. properties: {
  50. comment: {
  51. type: 'string'
  52. },
  53. context: {
  54. type: 'string'
  55. },
  56. message: {
  57. type: 'string'
  58. }
  59. },
  60. type: 'object'
  61. }]
  62. },
  63. type: 'array'
  64. }
  65. },
  66. required: ['contexts'],
  67. type: 'object'
  68. }],
  69. type: 'suggestion'
  70. }
  71. });
  72. exports.default = _default;
  73. module.exports = exports.default;
  74. //# sourceMappingURL=noRestrictedSyntax.js.map