Prettier is an opinionated code formatter.
Permalink
Failed to load latest commit information.
.circleci Report test summaries to CircleCI (#4704) Jul 7, 2018
.github chore: bump Prettier dependency to 1.14.3 Sep 19, 2018
bin refactor(cli): separate files and make it pure as possible (#2730) Sep 3, 2017
docs Fix a typo in precommit.md Option 4. (#5196) Oct 7, 2018
scripts feat(html): switch to htmlparser2 (#5127) Sep 22, 2018
src Break nested TSConditionalType (#5272) Oct 15, 2018
tests Break nested TSConditionalType (#5272) Oct 15, 2018
tests_config feat(html): switch to htmlparser2 (#5127) Sep 22, 2018
tests_integration feat(html): whitespace-sensitive formatting (#5168) Oct 13, 2018
website Fix <Language showName /> prop type (#5265) Oct 14, 2018
.appveyor.yml Get tests passing on Windows (#4579) May 28, 2018
.codecov.yml Improve coverage and remove some dead code (#2504) Jul 17, 2017
.eslintignore Introduce Release script (#4631) Jun 5, 2018
.eslintrc.yml lint fixes Apr 17, 2018
.flowconfig Build the dist/ with rollup (#1794) May 29, 2017
.gitignore Report test summaries to CircleCI (#4704) Jul 7, 2018
.ignore Remove .npmignore and update .ignore (#2560) Jul 30, 2017
.pre-commit-hooks.yaml Add support for markdown with pre-commit (#4021) Feb 21, 2018
.prettierignore Implement getSupportInfo() and use it for inference (#3033) Nov 3, 2017
.travis.yml Travis - Allow failures in Node 6 (#4690) Jun 14, 2018
.yarnrc Add .yarnrc to use exact versions (#2016) Jun 7, 2017
CHANGELOG.md chore: bump Prettier dependency to 1.14.3 Sep 19, 2018
CONTRIBUTING.md docs(perf): add performance section to CONTRIBUTING.md (#4846) Jul 23, 2018
LICENSE Happy new year 2018! (#3620) Dec 31, 2017
README.md Adjust badges on the README (#5189) Oct 5, 2018
commands.md Add a new `trim` command to trim whitespaces in the current line (#4772) Oct 6, 2018
index.js refactor: move index.js and standalone.js to src (#5054) Sep 6, 2018
jest.config.js chore: extract jest snapshot serializers (#5034) Sep 1, 2018
package.json feat(html): whitespace-sensitive formatting (#5168) Oct 13, 2018
standalone.js refactor: move index.js and standalone.js to src (#5054) Sep 6, 2018
yarn.lock feat(html): whitespace-sensitive formatting (#5168) Oct 13, 2018

README.md

Prettier Banner

Opinionated Code Formatter

JavaScript · Flow · TypeScript · CSS · SCSS · Less · JSX · Vue · GraphQL · JSON · Markdown · YAML · Your favorite language?

Travis CI Build Status CircleCI Build Status AppVeyor Build Status Codecov Coverage Status Blazing Fast
npm version weekly downloads from npm code style: prettier Chat on Gitter Follow Prettier on Twitter

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

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

Output

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 Prettiercode style: prettier

[![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.