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.

postcssPlugin.js 697B

12345678910111213141516171819202122232425
  1. 'use strict';
  2. const _ = require('lodash');
  3. const createStylelint = require('./createStylelint');
  4. const path = require('path');
  5. const postcss = require('postcss');
  6. //'block-no-empty': bool || Array
  7. module.exports = postcss.plugin('stylelint', (options = {}) => {
  8. const tailoredOptions = options.rules ? { config: options } : options;
  9. const stylelint = createStylelint(tailoredOptions);
  10. return (root, result) => {
  11. let filePath = options.from || _.get(root, 'source.input.file');
  12. if (filePath !== undefined && !path.isAbsolute(filePath)) {
  13. filePath = path.join(process.cwd(), filePath);
  14. }
  15. return stylelint._lintSource({
  16. filePath,
  17. existingPostcssResult: result,
  18. });
  19. };
  20. });