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.

mediaFeatureColonSpaceChecker.js 854B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // @ts-nocheck
  2. 'use strict';
  3. const atRuleParamIndex = require('../utils/atRuleParamIndex');
  4. const report = require('../utils/report');
  5. const styleSearch = require('style-search');
  6. module.exports = function (opts) {
  7. opts.root.walkAtRules(/^media$/i, (atRule) => {
  8. const params = atRule.raws.params ? atRule.raws.params.raw : atRule.params;
  9. styleSearch({ source: params, target: ':' }, (match) => {
  10. checkColon(params, match.startIndex, atRule);
  11. });
  12. });
  13. function checkColon(source, index, node) {
  14. opts.locationChecker({
  15. source,
  16. index,
  17. err: (m) => {
  18. const colonIndex = index + atRuleParamIndex(node);
  19. if (opts.fix && opts.fix(node, colonIndex)) {
  20. return;
  21. }
  22. report({
  23. message: m,
  24. node,
  25. index: colonIndex,
  26. result: opts.result,
  27. ruleName: opts.checkedRuleName,
  28. });
  29. },
  30. });
  31. }
  32. };