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.

selectorListCommaWhitespaceChecker.js 894B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // @ts-nocheck
  2. 'use strict';
  3. const isStandardSyntaxRule = require('../utils/isStandardSyntaxRule');
  4. const report = require('../utils/report');
  5. const styleSearch = require('style-search');
  6. module.exports = function (opts) {
  7. opts.root.walkRules((rule) => {
  8. if (!isStandardSyntaxRule(rule)) {
  9. return;
  10. }
  11. const selector = rule.raws.selector ? rule.raws.selector.raw : rule.selector;
  12. styleSearch(
  13. {
  14. source: selector,
  15. target: ',',
  16. functionArguments: 'skip',
  17. },
  18. (match) => {
  19. checkDelimiter(selector, match.startIndex, rule);
  20. },
  21. );
  22. });
  23. function checkDelimiter(source, index, node) {
  24. opts.locationChecker({
  25. source,
  26. index,
  27. err: (m) => {
  28. if (opts.fix && opts.fix(node, index)) {
  29. return;
  30. }
  31. report({
  32. message: m,
  33. node,
  34. index,
  35. result: opts.result,
  36. ruleName: opts.checkedRuleName,
  37. });
  38. },
  39. });
  40. }
  41. };