Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

prettier

> 前端框架
Open source

Prettier is an opinionated code formatter.

52.2K stars0 likes7 views
WebsiteGitHub

About

Prettier is an opinionated code formatter.

Opinionated Code Formatter

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


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

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

Output

javascript
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 →

markdown

Contributing

See CONTRIBUTING.md.

Issues· 1464 open

View all issuesOpen on GitHub
  • #15461

    Dependency Dashboard

    dependencyUpdated Sep 28, 2026
  • #20176

    Line comment between a superclass and its type arguments is unstable

    Updated Sep 28, 2026
  • #20175

    Comment between `export` and a decorator adds a blank line on every format

    Updated Sep 28, 2026
  • #20174

    Own-line block comment after a type annotation's `:` or after `...` is unstable

    Updated Sep 28, 2026
  • #20173

    Comment on a JSX superclass is duplicated on every format

    Updated Sep 28, 2026
  • #20172

    `semi: false`: `// prettier-ignore` before an ASI-protected statement drops its `;` (regression in 3.8)

    Updated Sep 28, 2026
  • #20171

    `/* prettier-ignore */` in a `for` initializer adds a second `;` (regression in 3.8)

    Updated Sep 28, 2026
  • #20170

    `semi: false`: a key unquoted by `quoteProps` loses its ASI protection

    Updated Sep 28, 2026
  • #20169

    Comment in a parameter property's default moves between the modifier and the name, which doesn't parse

    Updated Sep 28, 2026
  • #20168

    JSX: a line comment between `<` and the tag name prints `<// c`, which doesn't parse

    Updated Sep 28, 2026

> Tags

JavaScriptangularastcssflow

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架