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.

declarationBangSpaceChecker.js 907B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // @ts-nocheck
  2. 'use strict';
  3. const declarationValueIndex = require('../utils/declarationValueIndex');
  4. const report = require('../utils/report');
  5. const styleSearch = require('style-search');
  6. module.exports = function (opts) {
  7. opts.root.walkDecls((decl) => {
  8. const indexOffset = declarationValueIndex(decl);
  9. const declString = decl.toString();
  10. const valueString = decl.toString().slice(indexOffset);
  11. if (!valueString.includes('!')) {
  12. return;
  13. }
  14. styleSearch({ source: valueString, target: '!' }, (match) => {
  15. check(declString, match.startIndex + indexOffset, decl);
  16. });
  17. });
  18. function check(source, index, node) {
  19. opts.locationChecker({
  20. source,
  21. index,
  22. err: (m) => {
  23. if (opts.fix && opts.fix(node, index)) {
  24. return;
  25. }
  26. report({
  27. message: m,
  28. node,
  29. index,
  30. result: opts.result,
  31. ruleName: opts.checkedRuleName,
  32. });
  33. },
  34. });
  35. }
  36. };