Back to Prettier

README

README.md

3.8.33.3 KB
Original Source

<h2 align="center">Opinionated Code Formatter</h2> <p align="center"> <em> JavaScript · TypeScript · Flow · JSX · JSON </em> <em> CSS · SCSS · Less </em> <em> HTML · Vue · Angular </em> <em> GraphQL · Markdown · YAML </em> <em> <a href="https://prettier.io/docs/plugins"> Your favorite language? </a> </em> </p> <p align="center"> <a href="https://github.com/prettier/prettier/actions?query=branch%3Amain"> </a> <a href="https://codecov.io/gh/prettier/prettier"> </a> <a href="https://x.com/acdlite/status/974390255393505280"> </a> <a href="https://www.npmjs.com/package/prettier"> </a> <a href="https://www.npmjs.com/package/prettier"> </a> <a href="https://github.com/prettier/prettier#badge"> </a> <a href="https://x.com/intent/follow?screen_name=PrettierCode"> </a> </p>

Intro

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.

Input

<!-- prettier-ignore -->
js
foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());

Output

js
foo(
  reallyLongArg(),
  omgSoManyParameters(),
  IShouldRefactorThis(),
  isThereSeriouslyAnotherOne(),
);

Prettier can be run in your editor on-save, in a pre-commit hook, or in CI environments to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again!


Documentation

Install · Options · CLI · API

Playground


Badge

Show the world you're using Prettier

md
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

Contributing

See CONTRIBUTING.md.