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.

checker.js 838B

12345678910111213141516171819202122232425262728293031323334
  1. 'use strict';
  2. const stylelintConfigPrettier = require('./index');
  3. const stylelint = require('stylelint');
  4. const { resolve } = require('path');
  5. const { hasOwnProperty } = Object.prototype;
  6. function check(path) {
  7. const resolvedPath = resolve(process.cwd(), path || '');
  8. return stylelint
  9. .createLinter()
  10. .getConfigForFile(resolvedPath)
  11. .then((config) => {
  12. const prettierRules = stylelintConfigPrettier.rules;
  13. const configRules = config.config.rules;
  14. const conflictingRules = [];
  15. Object.keys(prettierRules).forEach((rule) => {
  16. if (
  17. hasOwnProperty.call(configRules, rule) &&
  18. configRules[rule] !== null &&
  19. configRules[rule][0] !== prettierRules[rule]
  20. ) {
  21. conflictingRules.push(rule);
  22. }
  23. });
  24. return conflictingRules.length ? conflictingRules : null;
  25. });
  26. }
  27. exports.check = check;