• Stars
    star
    48,256
  • Rank 223 (Top 0.01 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated 3 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Prettier is an opinionated code formatter.

Prettier Banner

Opinionated Code Formatter

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

Github Actions Build Status Github Actions Build Status Github Actions Build Status Codecov Coverage Status Blazing Fast
npm version weekly downloads from npm code style: prettier 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.

More Repositories

1

eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with Prettier.
JavaScript
5,171
star
2

prettier-vscode

Visual Studio Code extension for Prettier
TypeScript
5,003
star
3

prettier-eslint

Code ➡️ prettier ➡️ eslint --fix ➡️ Formatted Code ✨
JavaScript
3,911
star
4

eslint-plugin-prettier

ESLint plugin for Prettier formatting
JavaScript
3,140
star
5

pretty-quick

⚡ Get Pretty Quick
TypeScript
2,161
star
6

vim-prettier

A Vim plugin for Prettier
Vim Script
1,751
star
7

plugin-php

Prettier PHP Plugin
PHP
1,704
star
8

plugin-ruby

Prettier Ruby Plugin
JavaScript
1,443
star
9

tslint-config-prettier

Use TSLint with Prettier without any conflict
TypeScript
1,233
star
10

prettier-atom

An atom package for the prettier formatter.
JavaScript
757
star
11

prettier-eslint-cli

CLI for prettier-eslint
JavaScript
526
star
12

plugin-python

Prettier Python Plugin
JavaScript
516
star
13

stylelint-config-prettier

Turns off all rules that are unnecessary or might conflict with prettier.
JavaScript
373
star
14

prettier-emacs

Minor mode to format JS code on file save
Emacs Lisp
368
star
15

stylelint-prettier

Stylelint plugin for Prettier formatting
JavaScript
328
star
16

plugin-swift

[DEPRECATED] Prettier Swift Plugin - WARNING: The AST parser is not stable yet
JavaScript
276
star
17

tslint-plugin-prettier

Runs Prettier as a TSLint rule and reports differences as individual TSLint issues
TypeScript
236
star
18

plugin-xml

Prettier XML plugin
JavaScript
218
star
19

prettier-browser-extension

Prettier Browser Extension
JavaScript
198
star
20

plugin-pug

Prettier Pug Plugin
TypeScript
193
star
21

plugin-lua

Prettier Lua Plugin (WIP)
Lua
79
star
22

prettier-logo

The Prettier logo.
JavaScript
38
star
23

prettier-cli

TypeScript
24
star
24

prettier-printer

Library for building and pretty printing text documents
JavaScript
23
star
25

yaml-unist-parser

A YAML parser that produces output compatible with unist
TypeScript
22
star
26

stylelint-config-prettier-scss

Turns off all CSS and SCSS rules that are unnecessary or might conflict with prettier.
JavaScript
19
star
27

prettier-linter-helpers

Helper functions for exposing prettier changes within linting tools
JavaScript
17
star
28

angular-estree-parser

A parser that converts Angular source code into an ESTree-compatible form
TypeScript
15
star
29

prettier-synchronized

Synchronous version of Prettier
JavaScript
14
star
30

prettier-rpc

Single-file build of prettier with JSON-RPC communication
JavaScript
13
star
31

prettier-regression-testing

Automates the prettier/prettier regression checks with GitHub Actions.
TypeScript
11
star
32

parse-srcset

A spec-conformant JavaScript parser for the HTML5 srcset attribute
JavaScript
8
star
33

plugin-haml

Plugin for the HAML template language
JavaScript
5
star
34

pre-commit

Mirror of Prettier package for pre-commit.
JavaScript
5
star
35

is-es5-identifier-name

Check if provided string is an `IdentifierName` as specified in ECMA262 edition 5.1 section 7.6.
JavaScript
2
star
36

core-test-fixtures

Test fixtures for Prettier core.
JavaScript
2
star
37

eslint-plugin-prettier-internal-rules

Wrapper for Prettier internal rules
JavaScript
1
star