prettier

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

Tool
npm
v3.9.6
52,238stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
90/100Excellent
Development Activity96
Maintenance96
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
92/100Excellent
Architecture92
Code Quality95
Innovation90
Learning Curve90

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 300 apps in this directory

Go
73%
GPL 3.0

1Panel

Devops · Hosting Control Panel · Monitoring

36,820

The only open-source VPS control panel with native AI agent runtime — deploy websites, Docker stacks, and local LLMs from one web interface.

View details
90
Repo Health
76
Technical
67
Dependency
Built with
Go73%
Vue27%
Updated 3 days ago
TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

166

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
TypeScript
99%
Other

Activepieces

Automation · AI Assistants

24,298

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
64
Dependency
Built with
TypeScript99%
Updated today
TypeScript
87%
Other

AFFiNE

Productivity · Project Management · Note Taking

72,238

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
67
Dependency
Built with
TypeScript87%
Updated yesterday
Python
66%
Apache 2.0

Agent Control

AI Agents

304

An open-source runtime control plane for AI agents — define safety guardrails once, apply them across agents built on LangChain, CrewAI, Google ADK, or AWS Strands, and update controls without redeploying code.

View details
75
Repo Health
71
Technical
70
Dependency
Built with
Python66%
TypeScript33%
Updated 6 days ago
Python
98%
MIT

Agent Lightning

AI Development

18,000

A Microsoft-built training framework that optimizes AI agents with reinforcement learning, automatic prompt optimization, or supervised fine-tuning — with near-zero code changes to your existing agent, in any framework.

View details
83
Repo Health
68
Technical
70
Dependency
Built with
Python98%
Updated 5 days ago
TypeScript
60%
Other

agenta

Developer Tools · Devops · AI Development

4,706

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript60%
Python38%
Updated yesterday
Rust
65%
Apache 2.0

agentgateway

AI Development · Developer Tools

4,739

An open source AI-native proxy that secures, observes, and governs agent-to-LLM, agent-to-tool, and agent-to-agent communication through MCP, A2A, and unified LLM routing.

View details
88
Repo Health
82
Technical
70
Dependency
Built with
Rust65%
Go23%
Updated yesterday
Python
86%
MIT

ai-toolkit

AI Development · AI Design Tools

11,914

An all-in-one open-source training suite for finetuning diffusion models—FLUX, SDXL, Wan video, and audio—on consumer GPU hardware via CLI or web UI.

View details
78
Repo Health
66
Technical
75
Dependency
Built with
Python86%
TypeScript13%
Updated yesterday

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

Search