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 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // @ts-nocheck
  2. 'use strict';
  3. const fixer = require('../functionCommaSpaceFix');
  4. const functionCommaSpaceChecker = require('../functionCommaSpaceChecker');
  5. const ruleMessages = require('../../utils/ruleMessages');
  6. const validateOptions = require('../../utils/validateOptions');
  7. const whitespaceChecker = require('../../utils/whitespaceChecker');
  8. const ruleName = 'function-comma-newline-after';
  9. const messages = ruleMessages(ruleName, {
  10. expectedAfter: () => 'Expected newline after ","',
  11. expectedAfterMultiLine: () => 'Expected newline after "," in a multi-line function',
  12. rejectedAfterMultiLine: () => 'Unexpected whitespace after "," in a multi-line function',
  13. });
  14. function rule(expectation, options, context) {
  15. const checker = whitespaceChecker('newline', expectation, messages);
  16. return (root, result) => {
  17. const validOptions = validateOptions(result, ruleName, {
  18. actual: expectation,
  19. possible: ['always', 'always-multi-line', 'never-multi-line'],
  20. });
  21. if (!validOptions) {
  22. return;
  23. }
  24. functionCommaSpaceChecker({
  25. root,
  26. result,
  27. locationChecker: checker.afterOneOnly,
  28. checkedRuleName: ruleName,
  29. fix: context.fix
  30. ? (div, index, nodes) => {
  31. return fixer({
  32. div,
  33. index,
  34. nodes,
  35. expectation,
  36. position: 'after',
  37. symb: context.newline,
  38. });
  39. }
  40. : null,
  41. });
  42. };
  43. }
  44. rule.ruleName = ruleName;
  45. rule.messages = messages;
  46. module.exports = rule;