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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // @ts-nocheck
  2. 'use strict';
  3. const _ = require('lodash');
  4. const isStandardSyntaxCombinator = require('../../utils/isStandardSyntaxCombinator');
  5. const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule');
  6. const parseSelector = require('../../utils/parseSelector');
  7. const report = require('../../utils/report');
  8. const ruleMessages = require('../../utils/ruleMessages');
  9. const validateOptions = require('../../utils/validateOptions');
  10. const ruleName = 'selector-combinator-whitelist';
  11. const messages = ruleMessages(ruleName, {
  12. rejected: (combinator) => `Unexpected combinator "${combinator}"`,
  13. });
  14. function rule(list) {
  15. return (root, result) => {
  16. const validOptions = validateOptions(result, ruleName, {
  17. actual: list,
  18. possible: [_.isString],
  19. });
  20. if (!validOptions) {
  21. return;
  22. }
  23. result.warn(
  24. `'${ruleName}' has been deprecated. Instead use 'selector-combinator-allowed-list'.`,
  25. {
  26. stylelintType: 'deprecation',
  27. stylelintReference: `https://github.com/stylelint/stylelint/blob/13.7.0/lib/rules/${ruleName}/README.md`,
  28. },
  29. );
  30. root.walkRules((ruleNode) => {
  31. if (!isStandardSyntaxRule(ruleNode)) {
  32. return;
  33. }
  34. const selector = ruleNode.selector;
  35. parseSelector(selector, result, ruleNode, (fullSelector) => {
  36. fullSelector.walkCombinators((combinatorNode) => {
  37. if (!isStandardSyntaxCombinator(combinatorNode)) {
  38. return;
  39. }
  40. const value = normalizeCombinator(combinatorNode.value);
  41. if (list.includes(value)) {
  42. return;
  43. }
  44. report({
  45. result,
  46. ruleName,
  47. message: messages.rejected(value),
  48. node: ruleNode,
  49. index: combinatorNode.sourceIndex,
  50. });
  51. });
  52. });
  53. });
  54. };
  55. }
  56. function normalizeCombinator(value) {
  57. return value.replace(/\s+/g, ' ');
  58. }
  59. rule.primaryOptionArray = true;
  60. rule.ruleName = ruleName;
  61. rule.messages = messages;
  62. rule.meta = { deprecated: true };
  63. module.exports = rule;