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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // @ts-nocheck
  2. 'use strict';
  3. const declarationValueIndex = require('../../utils/declarationValueIndex');
  4. const findAnimationName = require('../../utils/findAnimationName');
  5. const keywordSets = require('../../reference/keywordSets');
  6. const report = require('../../utils/report');
  7. const ruleMessages = require('../../utils/ruleMessages');
  8. const validateOptions = require('../../utils/validateOptions');
  9. const ruleName = 'no-unknown-animations';
  10. const messages = ruleMessages(ruleName, {
  11. rejected: (animationName) => `Unexpected unknown animation name "${animationName}"`,
  12. });
  13. function rule(actual) {
  14. return (root, result) => {
  15. const validOptions = validateOptions(result, ruleName, { actual });
  16. if (!validOptions) {
  17. return;
  18. }
  19. const declaredAnimations = new Set();
  20. root.walkAtRules(/(-(moz|webkit)-)?keyframes/i, (atRule) => {
  21. declaredAnimations.add(atRule.params);
  22. });
  23. root.walkDecls((decl) => {
  24. if (decl.prop.toLowerCase() === 'animation' || decl.prop.toLowerCase() === 'animation-name') {
  25. const animationNames = findAnimationName(decl.value);
  26. if (animationNames.length === 0) {
  27. return;
  28. }
  29. animationNames.forEach((animationNameNode) => {
  30. if (keywordSets.animationNameKeywords.has(animationNameNode.value.toLowerCase())) {
  31. return;
  32. }
  33. if (declaredAnimations.has(animationNameNode.value)) {
  34. return;
  35. }
  36. report({
  37. result,
  38. ruleName,
  39. message: messages.rejected(animationNameNode.value),
  40. node: decl,
  41. index: declarationValueIndex(decl) + animationNameNode.sourceIndex,
  42. });
  43. });
  44. }
  45. });
  46. };
  47. }
  48. rule.ruleName = ruleName;
  49. rule.messages = messages;
  50. module.exports = rule;