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.

processors.md 1.1KB

12345678910111213141516171819202122232425262728
  1. # Writing processors
  2. Processors are functions that hook into stylelint's pipeline, modifying code on its way into stylelint and modifying results on their way out.
  3. **Their use is discouraged in favor of [PostCSS syntaxes](../about/syntaxes.md).**
  4. Processor modules are functions that accept an options object and return an object with the following the functions, which hook into the processing of each file:
  5. - **code**: A function that accepts two arguments, the file's code and the file's path, and returns a string for stylelint to lint.
  6. - **result**: A function that accepts two arguments, the file's stylelint result object and the file's path, and either mutates the result object (returning nothing) or returns a new one.
  7. ```js
  8. // my-processor.js
  9. module.exports = function (options) {
  10. return {
  11. code: function (input, filepath) {
  12. // ...
  13. return transformedCode;
  14. },
  15. result: function (stylelintResult, filepath) {
  16. // ...
  17. return transformedResult;
  18. }
  19. };
  20. };
  21. ```
  22. _Processor options must be JSON-friendly_ because users will need to include them in `.stylelintrc` files.