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.

README.md 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # stylelint-prettier [![Build Status](https://github.com/prettier/stylelint-prettier/workflows/CI/badge.svg?branch=master)](https://github.com/prettier/stylelint-prettier/actions?query=workflow%3ACI+branch%3Amaster)
  2. Runs [Prettier](https://github.com/prettier/prettier) as a [Stylelint](https://stylelint.io/) rule and reports differences as individual Stylelint issues.
  3. ## Sample
  4. Given the input file `style.css`:
  5. <!-- prettier-ignore -->
  6. ```css
  7. .insert {
  8. display: block
  9. }
  10. .alter:after {color: red; content: 'example'}
  11. .delete {
  12. display: block;;
  13. }
  14. ```
  15. Running `./node_modules/.bin/stylelint style.css` shall output:
  16. ```
  17. style.css
  18. 2:17 ✖ Insert ";" prettier/prettier
  19. 5:15 ✖ Replace "color:·red;·content:·'example'" with prettier/prettier
  20. "⏎··color:·red;⏎··content:·"example";⏎"
  21. 8:17 ✖ Delete ";" prettier/prettier
  22. ```
  23. ## Installation
  24. ```sh
  25. npm install --save-dev stylelint-prettier prettier
  26. ```
  27. **_`stylelint-prettier` does not install Prettier or Stylelint for you._** _You must install these yourself._
  28. Then, in your `.stylelintrc`:
  29. ```json
  30. {
  31. "plugins": ["stylelint-prettier"],
  32. "rules": {
  33. "prettier/prettier": true
  34. }
  35. }
  36. ```
  37. ## Recommended Configuration
  38. This plugin works best if you disable all other Stylelint rules relating to code formatting, and only enable rules that detect patterns in the AST. (If another active Stylelint rule disagrees with `prettier` about how code should be formatted, it will be impossible to avoid lint errors.) You can use [stylelint-config-prettier](https://github.com/prettier/stylelint-config-prettier) to disable all formatting-related Stylelint rules.
  39. If your desired formatting does not match the `prettier` output, you should use a different tool such as [prettier-stylelint](https://github.com/hugomrdias/prettier-stylelint) instead.
  40. To integrate this plugin with `stylelint-config-prettier`, you can use the `"recommended"` configuration:
  41. 1. In addition to the above installation instructions, install `stylelint-config-prettier`:
  42. ```sh
  43. npm install --save-dev stylelint-config-prettier
  44. ```
  45. 2. Then replace the plugins and rules declarations in your `.stylelintrc` that you added in the prior section with:
  46. ```json
  47. {
  48. "extends": ["stylelint-prettier/recommended"]
  49. }
  50. ```
  51. This does three things:
  52. 1. Enables the `stylelint-plugin-prettier` plugin.
  53. 2. Enables the `prettier/prettier` rule.
  54. 3. Extends the `stylelint-config-prettier` configuration.
  55. You can then set Prettier's own options inside a `.prettierrc` file.
  56. ## Options
  57. _stylelint-prettier will honor your `.prettierrc` file by default_. You only
  58. need this section if you wish to override those settings.
  59. > Note: While it is possible to pass options to Prettier via your Stylelint configuration file, it is not recommended because editor extensions such as `prettier-atom` and `prettier-vscode` **will** read [`.prettierrc`](https://prettier.io/docs/en/configuration.html), but **won't** read settings from Stylelint, which can lead to an inconsistent experience.
  60. Objects are passed directly to Prettier as [options](https://prettier.io/docs/en/options.html). Example:
  61. ```json
  62. {
  63. "rules": {
  64. "prettier/prettier": [true, {"singleQuote": true, "tabWidth": 4}]
  65. }
  66. }
  67. ```
  68. NB: This option will merge and override any config set with `.prettierrc` files (for Prettier < 1.7.0, config files are ignored)
  69. ---
  70. ## Contributing
  71. See [CONTRIBUTING.md](https://github.com/prettier/stylelint-prettier/blob/master/.github/CONTRIBUTING.md)
  72. ## Inspiration
  73. The layout for this codebase and base configuration of prettier was taken from <https://github.com/prettier/eslint-plugin-prettier>