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.

107 lines
3.6 KiB

4 years ago
  1. ![Prettier Banner](https://raw.githubusercontent.com/prettier/prettier-logo/master/images/prettier-banner-light.png)
  2. <h2 align="center">Opinionated Code Formatter</h2>
  3. <p align="center">
  4. <em>
  5. JavaScript
  6. · TypeScript
  7. · Flow
  8. · JSX
  9. · JSON
  10. </em>
  11. <br />
  12. <em>
  13. CSS
  14. · SCSS
  15. · Less
  16. </em>
  17. <br />
  18. <em>
  19. HTML
  20. · Vue
  21. · Angular
  22. </em>
  23. <br />
  24. <em>
  25. GraphQL
  26. · Markdown
  27. · YAML
  28. </em>
  29. <br />
  30. <em>
  31. <a href="https://prettier.io/docs/en/plugins.html">
  32. Your favorite language?
  33. </a>
  34. </em>
  35. </p>
  36. <p align="center">
  37. <a href="https://dev.azure.com/prettier/prettier/_build/latest?definitionId=5">
  38. <img alt="Azure Pipelines Build Status" src="https://img.shields.io/azure-devops/build/prettier/79013671-677c-4846-a6d8-3050d40e21c0/5.svg?style=flat-square&label=build&branchName=master"></a>
  39. <a href="https://codecov.io/gh/prettier/prettier">
  40. <img alt="Codecov Coverage Status" src="https://img.shields.io/codecov/c/github/prettier/prettier.svg?style=flat-square"></a>
  41. <a href="https://twitter.com/acdlite/status/974390255393505280">
  42. <img alt="Blazing Fast" src="https://img.shields.io/badge/speed-blazing%20%F0%9F%94%A5-brightgreen.svg?style=flat-square"></a>
  43. <br/>
  44. <a href="https://www.npmjs.com/package/prettier">
  45. <img alt="npm version" src="https://img.shields.io/npm/v/prettier.svg?style=flat-square"></a>
  46. <a href="https://www.npmjs.com/package/prettier">
  47. <img alt="weekly downloads from npm" src="https://img.shields.io/npm/dw/prettier.svg?style=flat-square"></a>
  48. <a href="#badge">
  49. <img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square"></a>
  50. <a href="https://gitter.im/jlongster/prettier">
  51. <img alt="Chat on Gitter" src="https://img.shields.io/gitter/room/jlongster/prettier.svg?style=flat-square"></a>
  52. <a href="https://twitter.com/PrettierCode">
  53. <img alt="Follow Prettier on Twitter" src="https://img.shields.io/twitter/follow/prettiercode.svg?label=follow+prettier&style=flat-square"></a>
  54. </p>
  55. ## Intro
  56. Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
  57. ### Input
  58. <!-- prettier-ignore -->
  59. ```js
  60. foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());
  61. ```
  62. ### Output
  63. ```js
  64. foo(
  65. reallyLongArg(),
  66. omgSoManyParameters(),
  67. IShouldRefactorThis(),
  68. isThereSeriouslyAnotherOne()
  69. );
  70. ```
  71. Prettier can be run [in your editor](http://prettier.io/docs/en/editors.html) on-save, in a [pre-commit hook](https://prettier.io/docs/en/precommit.html), or in [CI environments](https://prettier.io/docs/en/cli.html#list-different) to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again!
  72. ---
  73. **[Documentation](https://prettier.io/docs/en/)**
  74. <!-- prettier-ignore -->
  75. [Install](https://prettier.io/docs/en/install.html) ·
  76. [Options](https://prettier.io/docs/en/options.html) ·
  77. [CLI](https://prettier.io/docs/en/cli.html) ·
  78. [API](https://prettier.io/docs/en/api.html)
  79. **[Playground](https://prettier.io/playground/)**
  80. ---
  81. ## Badge
  82. Show the world you're using _Prettier_ → [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
  83. ```md
  84. [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
  85. ```
  86. ## Contributing
  87. See [CONTRIBUTING.md](CONTRIBUTING.md).