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.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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-space-after';
  9. const messages = ruleMessages(ruleName, {
  10. expectedAfter: () => 'Expected single space after ","',
  11. rejectedAfter: () => 'Unexpected whitespace after ","',
  12. expectedAfterSingleLine: () => 'Expected single space after "," in a single-line function',
  13. rejectedAfterSingleLine: () => 'Unexpected whitespace after "," in a single-line function',
  14. });
  15. function rule(expectation, options, context) {
  16. const checker = whitespaceChecker('space', expectation, messages);
  17. return (root, result) => {
  18. const validOptions = validateOptions(result, ruleName, {
  19. actual: expectation,
  20. possible: ['always', 'never', 'always-single-line', 'never-single-line'],
  21. });
  22. if (!validOptions) {
  23. return;
  24. }
  25. functionCommaSpaceChecker({
  26. root,
  27. result,
  28. locationChecker: checker.after,
  29. checkedRuleName: ruleName,
  30. fix: context.fix
  31. ? (div, index, nodes) => {
  32. return fixer({
  33. div,
  34. index,
  35. nodes,
  36. expectation,
  37. position: 'after',
  38. symb: ' ',
  39. });
  40. }
  41. : null,
  42. });
  43. };
  44. }
  45. rule.ruleName = ruleName;
  46. rule.messages = messages;
  47. module.exports = rule;