eslint-plugin-prettier

Run Prettier as an ESLint rule that reports formatting differences as autofixable lint errors.

Tool
npm
v5.5.6
3,653 stars
MIT License

Repository Health

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

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
74 /100 Good
Architecture 82
Code Quality 85
Innovation 60
Learning Curve 70

eslint-plugin-prettier integrates Prettier directly into ESLint’s rule engine, reporting any formatting difference between your source and Prettier’s expected output as a standard ESLint prettier/prettier violation — insertions, deletions, and replacements are all surfaced with precise line/column locations and can be auto-fixed via eslint --fix.

Rather than reimplementing formatting logic, the plugin lazily loads Prettier through a synckit-backed worker so a single ESLint rule visitor can call Prettier’s promise-based API synchronously, and it ships ready-made recommended configs for both legacy .eslintrc and flat eslint.config.js setups that also enable eslint-config-prettier to silence conflicting style rules.

What You Get

  • A prettier/prettier ESLint rule that reports every formatting difference as an autofixable lint error
  • Ready-made recommended configs for both legacy .eslintrc and flat eslint.config.js setups
  • Automatic disabling of conflicting ESLint formatting rules via bundled eslint-config-prettier integration
  • Support for virtual files from other ESLint processors (Markdown, HTML, GraphQL, Vue, Svelte) without double-formatting

Common Use Cases

  • Enforcing consistent code formatting across a team without a separate Prettier CI step
  • Auto-fixing formatting violations during eslint --fix or on save in an editor
  • Migrating a codebase from format-related ESLint rules to Prettier-driven formatting
  • Catching formatting drift in pull requests via a single eslint check

Under The Hood

Architecture Single-file plugin (eslint-plugin-prettier.js) exports one ESLint rule that hooks the top-level AST node type, lazily requiring synckit’s createSyncFn against a separate worker.mjs script to bridge Prettier’s promise-based API into ESLint’s synchronous rule visitor; the worker resolves .prettierrc/.editorconfig via prettier.resolveConfig, infers a parser via prettier.getFileInfo, and formats via prettier.format(), returning the formatted string across the process boundary. Differences between source and formatted output are computed with prettier-linter-helpers’s generateDifferences and reported as individual ESLint issues with precise fix ranges. A recommended.js/recommended.d.ts pair composes the plugin with eslint-config-prettier’s rule-disabling config for flat-config consumers, while legacy .eslintrc consumers get an equivalent configs.recommended entry inside the plugin object itself. This is about as flat and single-purpose an architecture as an ESLint plugin can have — no internal layering beyond the worker-process split needed for the sync/async bridge.

Tech Stack Plain CommonJS module for the main plugin entry, ESM worker invoked via synckit, with runtime dependencies limited to prettier-linter-helpers (diff/invisible-character formatting) and synckit (sync-over-async worker bridge); peer dependencies are eslint, eslint-config-prettier, and prettier, reflecting that the plugin does no bundling of its own and defers entirely to the host project’s installed versions. Devtooling is comprehensive: a recent major-version ESLint running in flat-config mode (dogfooding itself via plugin:prettier/recommended), Mocha for tests, Changesets for versioned releases, commitlint plus simple-git-hooks for commit discipline, and a pnpm workspace with a patched dependency supporting the remark-based docs lint pipeline.

Code Quality Tests live under test/ as numbered .txt fixture files covering dozens of formatting scenarios plus named edge cases (Vue, GraphQL, MDX, JSON), driven through Mocha via test/prettier.mjs — a snapshot-style fixture approach well suited to a rule whose job is literally “does the diff match.” Error handling is explicit: both the rule and the worker special-case SyntaxError from Prettier and re-throw anything unexpected, and the rule strips Prettier’s redundant code-frame text from re-reported messages. Typing is done via JSDoc @ts-check annotations and @import typedefs rather than compiled TypeScript, checked by lint and format scripts that run in CI. Test fixture coverage across markdown/html/graphql/vue/svelte edge cases is notably thorough for a package this size.

API Design The plugin’s entire public surface is one rule name (prettier/prettier) plus two ready-made config exports, about as low-boilerplate as an ESLint integration gets — most consumers add a single extends entry or import the flat-config object and never touch the rule’s options directly. The rule’s own options mirror Prettier’s own API rather than inventing new configuration vocabulary, keeping the learning curve close to zero for anyone who already knows Prettier. The README documents edge cases thoroughly (Svelte support caveats, a documented arrow-body-style/prefer-arrow-callback interaction bug) rather than just happy-path usage. Running a formatter through a linter’s fixer mechanism is a well-established pattern predating this package, so it isn’t technically novel — but the developer experience is exemplary for its category.

Used by 102 apps in this directory

Rust
78%
AGPL 3.0

Lemmy

Community · Social Media

14,614

Federated, self-hosted Reddit alternative with full community ownership and no corporate control.

View details
89
Repo Health
74
Technical
62
Dependency
Built with
Rust 78%
PLpgSQL 14%
Updated 2 weeks ago
TypeScript
82%
MIT

LibreChat

AI Assistants · Developer Tools

45,009

Unite every major AI model in one self-hosted chat platform with agents, code execution, MCP tools, and enterprise authentication.

View details
93
Repo Health
81
Technical
65
Dependency
Built with
TypeScript 82%
JavaScript 17%
Updated 1 weeks ago
Python
58%
MIT

LibrePhotos

File Storage

8,083

Self-hosted photo library with AI-powered face recognition, semantic search, and automatic event albums — no cloud required.

View details
83
Repo Health
78
Technical
65
Dependency
Built with
Python 58%
TypeScript 40%
Updated 1 weeks ago
JavaScript
43%
Other

LimeSurvey

Forms Surveys

3,736

The world's most flexible open-source survey platform with 900+ templates, conditional logic, 80+ languages, and full GDPR compliance for any scale.

View details
86
Repo Health
62
Technical
63
Dependency
Built with
JavaScript 43%
PHP 35%
CSS 12%
Updated 1 weeks ago
TypeScript
44%
Other

Magic

AI Agents · Automation · Low Code Platforms

5,043

Magic is an enterprise-grade open-source AI agent platform combining a generalist AI agent, workflow engine, IM, and collaborative office system for running an AI-powered digital workforce.

View details
70
Repo Health
79
Technical
65
Dependency
Built with
TypeScript 44%
PHP 32%
Updated 1 months ago
PHP
82%
Other

Mautic

Automation · Ecommerce · Marketing

10,570

The world's largest open source marketing automation platform — own your data, run multi-channel campaigns, and escape vendor lock-in forever.

View details
97
Repo Health
76
Technical
63
Dependency
Built with
PHP 82%
Updated 2 weeks ago
TypeScript
88%
MIT

medusa

Ecommerce

36,494

The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.

View details
93
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 88%
JavaScript 12%
Updated 2 weeks ago
TypeScript
42%
MIT

MentraOS

AI Development · Developer Tools

2,370

The open source operating system and SDK that lets developers build one app and run it across smart glasses from Even Realities, Vuzix, Mentra Live, and more.

View details
92
Repo Health
77
Technical
66
Dependency
Built with
TypeScript 42%
Java 20%
Kotlin 13%
Updated 1 weeks ago
Python
58%
Apache 2.0

MLflow

AI Development · Monitoring

28,154

The open source AI engineering platform for debugging, evaluating, monitoring, and optimizing production LLMs and agents at scale.

View details
97
Repo Health
86
Technical
66
Dependency
Built with
Python 58%
TypeScript 33%
Updated 1 weeks 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