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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // @ts-nocheck
  2. 'use strict';
  3. const report = require('../../utils/report');
  4. const ruleMessages = require('../../utils/ruleMessages');
  5. const validateOptions = require('../../utils/validateOptions');
  6. const ruleName = 'no-missing-end-of-source-newline';
  7. const messages = ruleMessages(ruleName, {
  8. rejected: 'Unexpected missing end-of-source newline',
  9. });
  10. function rule(primary, _, context) {
  11. return (root, result) => {
  12. const validOptions = validateOptions(result, ruleName, { primary });
  13. if (!validOptions) {
  14. return;
  15. }
  16. if (root.source.inline || root.source.lang === 'object-literal') {
  17. return;
  18. }
  19. const rootString = context.fix ? root.toString() : root.source.input.css;
  20. if (!rootString.trim() || rootString.endsWith('\n')) {
  21. return;
  22. }
  23. // Fix
  24. if (context.fix) {
  25. root.raws.after = context.newline;
  26. return;
  27. }
  28. report({
  29. message: messages.rejected,
  30. node: root,
  31. index: rootString.length - 1,
  32. result,
  33. ruleName,
  34. });
  35. };
  36. }
  37. rule.ruleName = ruleName;
  38. rule.messages = messages;
  39. module.exports = rule;