MCPcopy
hub / github.com/prettier/prettier

github.com/prettier/prettier @3.9.4 sqlite

repository ↗ · DeepWiki ↗ · release 3.9.4 ↗
8,163 symbols 19,013 edges 5,679 files 573 documented · 7%
README

Prettier Banner

Opinionated Code Formatter

JavaScript · TypeScript · Flow · JSX · JSON

CSS · SCSS · Less

HTML · Vue · Angular

GraphQL · Markdown · YAML

Your favorite language?

CI Status Coverage Status Blazing Fast

npm version weekly downloads from npm code style: prettier Follow Prettier on X

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.

Extension points exported contracts — how you extend this code

Environment1 (Interface)
(no doc) [27 implementers]
tests/format/flow/interface-types/break/break.js
Attribute (Interface)
(no doc)
types/angular-html-parser/index.d.ts
Config (Interface)
(no doc)
src/index.d.ts
Align (Interface)
(no doc)
src/document/public.d.ts
ObjectWithLoc (Interface)
(no doc)
src/language-js/types/flow-estree.d.ts
Nested1 (Interface)
(no doc)
tests/dts/unit/cases/print.ts
J (Interface)
(no doc) [22 implementers]
tests/format/flow/flow-repo/interface/test3.js
CDATA (Interface)
(no doc)
types/angular-html-parser/index.d.ts

Core symbols most depended-on inside this repo

runFormatTest
called by 1698
tests/config/format-test/run-format-test.js
print
called by 381
src/language-js/print/index.js
require
called by 347
tests/format/flow/flow-repo/require/not_builtin_require.js
runCli
called by 269
tests/integration/run-cli.js
group
called by 263
src/document/builders/group.js
map
called by 211
tests/format/flow/flow-repo/builtins/genericfoo.js
indent
called by 162
src/cli/usage.js
map
called by 156
src/language-html/parse/ast.js

Shape

Function 4,006
Class 2,590
Method 951
Interface 566
Enum 50

Languages

TypeScript100%

Modules by API surface

src/language-js/types/flow-estree.d.ts256 symbols
tests/format/flow/flow-repo/logical/logical.js65 symbols
tests/format/flow/flow-repo/super/constructor.js64 symbols
src/language-html/utilities/index.js52 symbols
tests/format/flow/flow-repo/private_class_fields/test.js50 symbols
tests/format/js/no-semi/class.js46 symbols
src/language-css/utilities/index.js46 symbols
tests/format/typescript/type-parameters-arguments/class-method.ts44 symbols
tests/format/typescript/conformance/classes/mixinAccessModifiers.ts42 symbols
tests/format/flow/flow-repo/dictionary/dictionary.js41 symbols
src/language-js/comments/handle-comments.js38 symbols
tests/format/js/class-extends/extends.js37 symbols

Dependencies from manifests, versioned

@angular/compiler22.0.4 · 1×
@babel/code-frame8.0.0 · 1×
@babel/generator8.0.0 · 1×
@babel/parser8.0.0 · 1×
@babel/types8.0.0 · 1×
@catppuccin/codemirror1.0.3 · 1×
@codemirror/autocomplete6.20.3 · 1×
@codemirror/commands6.10.4 · 1×
@codemirror/language6.12.4 · 1×
@codemirror/language-data6.5.2 · 1×
@codemirror/lint6.9.7 · 1×
@codemirror/state6.7.0 · 1×

Datastores touched

(mongodb)Database · 1 repos
postsDatabase · 1 repos

For agents

$ claude mcp add prettier \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact