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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // @ts-nocheck
  2. 'use strict';
  3. const _ = require('lodash');
  4. const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule');
  5. const keywordSets = require('../../reference/keywordSets');
  6. const optionsMatches = require('../../utils/optionsMatches');
  7. const report = require('../../utils/report');
  8. const ruleMessages = require('../../utils/ruleMessages');
  9. const validateOptions = require('../../utils/validateOptions');
  10. const vendor = require('../../utils/vendor');
  11. const ruleName = 'at-rule-no-unknown';
  12. const messages = ruleMessages(ruleName, {
  13. rejected: (atRule) => `Unexpected unknown at-rule "${atRule}"`,
  14. });
  15. function rule(actual, options) {
  16. return (root, result) => {
  17. const validOptions = validateOptions(
  18. result,
  19. ruleName,
  20. { actual },
  21. {
  22. actual: options,
  23. possible: {
  24. ignoreAtRules: [_.isString, _.isRegExp],
  25. },
  26. optional: true,
  27. },
  28. );
  29. if (!validOptions) {
  30. return;
  31. }
  32. root.walkAtRules((atRule) => {
  33. if (!isStandardSyntaxAtRule(atRule)) {
  34. return;
  35. }
  36. const name = atRule.name;
  37. // Return early if at-rule is to be ignored
  38. if (optionsMatches(options, 'ignoreAtRules', atRule.name)) {
  39. return;
  40. }
  41. if (vendor.prefix(name) || keywordSets.atRules.has(name.toLowerCase())) {
  42. return;
  43. }
  44. report({
  45. message: messages.rejected(`@${name}`),
  46. node: atRule,
  47. ruleName,
  48. result,
  49. });
  50. });
  51. };
  52. }
  53. rule.ruleName = ruleName;
  54. rule.messages = messages;
  55. module.exports = rule;