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.

index.js 922B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // @ts-nocheck
  2. 'use strict';
  3. const report = require('../../utils/report');
  4. const ruleMessages = require('../../utils/ruleMessages');
  5. const validateOptions = require('../../utils/validateOptions');
  6. const ruleName = 'comment-no-empty';
  7. const messages = ruleMessages(ruleName, {
  8. rejected: 'Unexpected empty comment',
  9. });
  10. function rule(actual) {
  11. return (root, result) => {
  12. const validOptions = validateOptions(result, ruleName, { actual });
  13. if (!validOptions) {
  14. return;
  15. }
  16. root.walkComments((comment) => {
  17. // To ignore inline SCSS comments
  18. if (comment.raws.inline || comment.inline) {
  19. return;
  20. }
  21. // To ignore comments that are not empty
  22. if (comment.text && comment.text.length !== 0) {
  23. return;
  24. }
  25. report({
  26. message: messages.rejected,
  27. node: comment,
  28. result,
  29. ruleName,
  30. });
  31. });
  32. };
  33. }
  34. rule.ruleName = ruleName;
  35. rule.messages = messages;
  36. module.exports = rule;