prettier

An opinionated code formatter that enforces consistent style across every language your project speaks.

Tool
npm
v3.9.9
52,316 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
91 /100 Excellent
Development Activity 100
Maintenance 96
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
92 /100 Excellent
Architecture 92
Code Quality 95
Innovation 90
Learning Curve 90

Prettier is an opinionated code formatter that parses your source code into an abstract syntax tree and re-prints it from scratch, applying its own consistent rules while honoring a configurable maximum line length. By removing all original styling and producing deterministic output, it ends debates over formatting entirely and lets teams focus code review on substance rather than whitespace.

With first-class support for JavaScript, TypeScript, JSX, CSS, SCSS, Less, HTML, Vue, Angular, GraphQL, Markdown, YAML, and JSON, Prettier runs from a CLI, an editor-on-save integration, a pre-commit hook, or a CI check. A programmatic API is also available for tools that need to format code on the fly.

What You Get

  • A zero-configuration CLI that formats entire projects in place with a single command
  • Built-in printers for 15+ languages including JavaScript, TypeScript, CSS, HTML, Vue, GraphQL, Markdown, and YAML
  • Editor integrations that reformat files automatically on save
  • A programmatic API (format, check, formatWithCursor, resolveConfig) for embedding formatting in your own tooling
  • A —check mode for CI that fails the build when files are not already formatted

Common Use Cases

  • Enforcing a single, non-negotiable code style across a team or monorepo
  • Reformatting files automatically on save in the editor
  • Gating pull requests in CI so unformatted code cannot be merged
  • Formatting a mixed-language codebase (JS, CSS, Markdown, YAML) with one tool

Under The Hood

Architecture Prettier is a parse-and-reprint pipeline rather than a rule-patching linter. src/main/core.js orchestrates the flow: source text is parsed by a language-specific parser (src/main/parse.js dispatches to plugins under src/language-js, src/language-css, src/language-html, etc.), then src/main/ast-to-doc.js converts the resulting AST into an intermediate representation called a Doc using the builder combinators in src/document. A Wadler-style pretty-printer (src/document/printer.js) walks the Doc and decides where to break lines based on the configured printWidth, before the result is serialized back to a string. Comments are re-attached to the new tree via src/main/comments, and options flow through normalize-options.js and core-options.evaluate.js.

Tech Stack Written in JavaScript (ESM, "type": "module", Node >=22) with TypeScript type definitions shipped in src/index.d.ts. It bundles a large set of best-in-class parsers as dependencies — @babel/parser, typescript, flow-parser, meriyah, oxc-parser, and hermes-parser for JS/TS; postcss (with less/scss plugins) for CSS; angular-html-parser and @glimmer/syntax for templates; unified/remark for Markdown; and yaml and graphql for their respective languages. The CLI is delegated to @prettier/cli, and the build is bundled for distribution.

Code Quality The project is exceptionally well-tested, with over 4,300 test files under tests/ split across format, unit, integration, and dts suites, run via Jest with snapshot testing to lock formatting output. Code is organized cleanly by language into self-contained src/language-* directories, each exposing parsers and printers behind a consistent plugin interface (Parser/Printer in the type definitions). Options are centrally normalized, and the Doc IR provides a clear, well-abstracted seam between parsing and printing.

API Design The public API is small and ergonomic: format(source, options) and check(source, options) return promises, with formatWithCursor, resolveConfig, resolveConfigFile, getSupportInfo, and getFileInfo covering configuration and tooling needs. The plugin contract (Plugin, Parser, Printer) is fully typed and lets third parties add languages without touching core. Extensive official documentation, a live playground, and near-zero required configuration make it trivial to adopt.

Used by 310 apps in this directory

Rust
52%
Other

Jan

AI Assistants

44,680

Run LLMs 100% locally with full privacy, or connect to cloud AI — your machine, your data, your control.

View details
90
Repo Health
81
Technical
65
Dependency
Built with
Rust 52%
TypeScript 44%
Updated 1 weeks ago
TypeScript
62%
MIT

Jitsu

Data Engineering

5,094

Open-source, fully-scriptable data ingestion engine that streams events from web, apps, and APIs to any data warehouse in real time.

View details
88
Repo Health
79
Technical
66
Dependency
Built with
TypeScript 62%
Go 36%
Updated 2 weeks ago
TypeScript
77%
Other

Joplin

Note Taking

56,513

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
60
Dependency
Built with
TypeScript 77%
JavaScript 14%
Updated 1 weeks ago
TypeScript
96%
AGPL 3.0

Kan

Project Management

5,703

An open-source, self-hostable Kanban board built as a modern Trello alternative with team workspaces, board permissions, and Trello import.

View details
85
Repo Health
78
Technical
67
Dependency
Built with
TypeScript 96%
Updated 2 weeks ago
Python
64%
Other

Keep

Automation · Devops · Monitoring

12,359

The open-source AIOps and alert management platform that unifies 130+ monitoring tools into a single pane of glass with AI-powered correlation, deduplication, and workflow automation.

View details
89
Repo Health
79
Technical
66
Dependency
Built with
Python 64%
TypeScript 36%
Updated 2 weeks ago
TypeScript
50%

Kener

Devops · Monitoring

5,181

Stunning, self-hosted status pages with real-time uptime monitoring, incident management, and multi-channel notifications in a single Docker container.

View details
86
Repo Health
76
Technical
67
Dependency
Built with
TypeScript 50%
Svelte 47%
Updated 3 weeks ago
Java
58%
Apache 2.0

Kestra

Automation · Data Engineering · Devops

28,388

Event-driven orchestration platform for data, AI, and infrastructure workflows — define everything in YAML, run anywhere at scale.

View details
93
Repo Health
81
Technical
72
Dependency
Built with
Java 58%
TypeScript 26%
Vue 15%
Updated 2 weeks ago
TypeScript
99%
MIT

KeystoneJS

CMS · Developer Tools

9,982

The superpowered headless CMS for developers built with GraphQL and React

View details
92
Repo Health
81
Technical
64
Dependency
Built with
TypeScript 99%
Updated 1 weeks ago
Python
51%
AGPL 3.0

Khoj

AI Assistants · Knowledge Management · Productivity

37,526

A self-hostable AI second brain that chats with your documents, searches the web, builds custom agents, and runs entirely on your own LLM.

View details
63
Repo Health
82
Technical
66
Dependency
Built with
Python 51%
TypeScript 36%
Updated 2 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers