LLMpediaThe first transparent, open encyclopedia generated by LLMs

Prettier (software)

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: Emscripten Hop 4
Expansion Funnel Raw 82 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted82
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
Prettier (software)
NamePrettier
TitlePrettier
Released2017
Programming languageJavaScript
Operating systemCross-platform
LicenseMIT

Prettier (software) Prettier is an opinionated code formatter for source code and markup that enforces a consistent style by parsing code and reprinting it with a deterministic layout. It integrates with many editors and continuous integration systems to standardize formatting across teams and projects, reducing style debates and merge conflicts. Prettier has influenced tooling practices used by developers working with web and systems software.

History

Prettier originated during discussions in open-source communities that included contributors associated with Facebook, Airbnb, Microsoft, Google, Mozilla Foundation, and other technology organizations seeking to reduce formatting friction in projects like React (software), Node.js, Babel (software), Webpack, and ESLint. Early prototypes were influenced by formatting tools used in projects linked to Ruby on Rails, Python Software Foundation, and tools for Go (programming language), with inspiration drawn from legacy formatters such as those used by GNU Project and innovations from academic work at institutions like MIT and Stanford University. Public releases in the late 2010s coincided with rising adoption across projects that also used TypeScript, Angular (software), Vue.js, and Next.js, and the project grew through contributions and issue reports from developers affiliated with GitHub, GitLab, Atlassian, and independent maintainers.

Features

Prettier provides opinionated formatting rules that aim for minimal configuration, a single canonical output style, and an idempotent format operation similar to tools used in projects like Rust (programming language)'s formatter and tools favored by contributors at Canonical (company). Core features include an abstract syntax tree (AST)–based reprinting engine, language-aware line breaking, automatic semicolon handling with options influenced by debates around ECMAScript style, and plugin hooks enabling extensions used in ecosystems such as Jest, Babel (software), Webpack, and Rollup (software). It offers integrations for editor platforms including Visual Studio Code, Atom (text editor), Sublime Text, and Vim, and supports noninteractive batch formatting suitable for CI systems like Travis CI, CircleCI, and Jenkins. Prettier's configurability trades off extensive style knobs for predictability, a design philosophy aligned with formatting projects in communities around Linux Foundation hosted initiatives and corporate engineering teams at Netflix and Dropbox.

Supported Languages and Ecosystem

Prettier supports a wide range of programming and markup languages used in projects maintained by organizations such as Facebook, Google, Microsoft, and open-source communities like those around jQuery and Semantic UI. Official and community plugins extend support to languages and formats encountered in ecosystems including JavaScript, TypeScript, Flow (type checker), JSX, JSON, YAML, GraphQL, Markdown, CSS, Less, SCSS, and template systems used by Handlebars.js and EJS. The ecosystem includes integrations with package managers and build tools maintained by groups like npm, Yarn (software), pnpm, Babel (software), ESBuild, and Parcel (software), enabling Prettier to be invoked in workflows used by companies such as Shopify and projects like Gatsby (software) and Create React App.

Architecture and Implementation

Prettier's implementation uses an AST-driven pipeline similar to compiler front ends developed in academic settings like Carnegie Mellon University and industrial compilers used in LLVM projects. The formatter parses source using parsers from ecosystems including Babel (software), TypeScript, and community parser projects, then prints code with a layout algorithm that balances line length targets and syntactic structure, a technique comparable to approaches documented in research by authors at University of California, Berkeley and University of Washington. Its core is implemented in Node.js and JavaScript, with performance-sensitive parts optimized incrementally by contributors from organizations such as Intel and AMD. Plugin architecture follows patterns used by extension systems in projects like Visual Studio Code and Eclipse Foundation IDEs, allowing third parties to register parsers and printers compatible with Prettier's formatting pipeline.

Adoption and Community

Prettier is widely adopted across corporate and open-source projects maintained by entities like Facebook, Google, Microsoft, Airbnb, Mozilla Foundation, and many projects hosted on GitHub. The project fosters community via contribution workflows and governance models seen in other large repositories maintained by Linux Foundation projects and collaborative efforts at Apache Software Foundation. Community resources include discussion on platforms used by developers at Stack Overflow and issue tracking patterns similar to those used by major projects on GitHub, and plugin authors are often affiliated with companies such as Shopify, Atlassian, and Stripe.

Criticism and Limitations

Critics from developer communities associated with Emacs and long-standing codebases in organizations like IBM and Oracle Corporation note limitations when applying an opinionated formatter to legacy code, citing risks reported in migration efforts similar to those undertaken in projects like OpenJDK and LibreOffice. Limitations include reduced configurability compared to style systems used by projects governed by PEP 8-adopting teams, incompatibilities with bespoke formatting conventions in enterprise repositories from SAP SE or Siemens, and edge cases in formatting domain-specific languages encountered in research from MIT Media Lab and toolchains in NASA software. Discussions around integration, rollback, and merge conflict behavior mirror those in communities around Git (software) and corporate code review processes at Facebook and Google.

Category:Software