Prettier is an opinionated code formatter.
JavaScript
· TypeScript
· Flow
· JSX
· JSON
CSS
· SCSS
· Less
HTML
· Vue
· Angular
GraphQL
· Markdown
· YAML
Your favorite language?
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.
foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());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!
Show the world you're using Prettier →
See CONTRIBUTING.md.
Dependency Dashboard
Line comment between a superclass and its type arguments is unstable
Comment between `export` and a decorator adds a blank line on every format
Own-line block comment after a type annotation's `:` or after `...` is unstable
Comment on a JSX superclass is duplicated on every format
`semi: false`: `// prettier-ignore` before an ASI-protected statement drops its `;` (regression in 3.8)
`/* prettier-ignore */` in a `for` initializer adds a second `;` (regression in 3.8)
`semi: false`: a key unquoted by `quoteProps` loses its ASI protection
Comment in a parameter property's default moves between the modifier and the name, which doesn't parse
JSX: a line comment between `<` and the tag name prints `<// c`, which doesn't parse