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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // @ts-nocheck
  2. 'use strict';
  3. const hasBlock = require('../../utils/hasBlock');
  4. const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule');
  5. const nextNonCommentNode = require('../../utils/nextNonCommentNode');
  6. const rawNodeString = require('../../utils/rawNodeString');
  7. const report = require('../../utils/report');
  8. const ruleMessages = require('../../utils/ruleMessages');
  9. const validateOptions = require('../../utils/validateOptions');
  10. const whitespaceChecker = require('../../utils/whitespaceChecker');
  11. const ruleName = 'at-rule-semicolon-newline-after';
  12. const messages = ruleMessages(ruleName, {
  13. expectedAfter: () => 'Expected newline after ";"',
  14. });
  15. function rule(actual, secondary, context) {
  16. const checker = whitespaceChecker('newline', actual, messages);
  17. return (root, result) => {
  18. const validOptions = validateOptions(result, ruleName, {
  19. actual,
  20. possible: ['always'],
  21. });
  22. if (!validOptions) {
  23. return;
  24. }
  25. root.walkAtRules((atRule) => {
  26. const nextNode = atRule.next();
  27. if (!nextNode) {
  28. return;
  29. }
  30. if (hasBlock(atRule)) {
  31. return;
  32. }
  33. if (!isStandardSyntaxAtRule(atRule)) {
  34. return;
  35. }
  36. // Allow an end-of-line comment
  37. const nodeToCheck = nextNonCommentNode(nextNode);
  38. if (!nodeToCheck) {
  39. return;
  40. }
  41. checker.afterOneOnly({
  42. source: rawNodeString(nodeToCheck),
  43. index: -1,
  44. err: (msg) => {
  45. if (context.fix) {
  46. nodeToCheck.raws.before = context.newline + nodeToCheck.raws.before;
  47. } else {
  48. report({
  49. message: msg,
  50. node: atRule,
  51. index: atRule.toString().length + 1,
  52. result,
  53. ruleName,
  54. });
  55. }
  56. },
  57. });
  58. });
  59. };
  60. }
  61. rule.ruleName = ruleName;
  62. rule.messages = messages;
  63. module.exports = rule;