Run Prettier as an ESLint rule
open sourceMITfree
eslint-plugin-prettier runs Prettier inside ESLint as a single rule, prettier/prettier, and reports each difference between your code and Prettier's output as an ESLint issue, so formatting shows up and is fixed with eslint --fix alongside lint errors. It works with both the flat eslint.config.js and the legacy .eslintrc configuration and supports Svelte. It's usually paired with eslint-config-prettier, which turns off the ESLint rules that conflict with Prettier.
Problems it solves
- see Prettier formatting problems as ESLint errors in my editor
- fix formatting and lint issues with one eslint --fix
- enforce Prettier formatting in CI through ESLint
Features
- runs Prettier as the ESLint rule prettier/prettier
- reports formatting differences as ESLint issues, fixable with eslint --fix
- flat eslint.config.js and legacy .eslintrc configs
- Svelte support
Alternatives
The same job
These do what eslint-plugin-prettier does.
- ESLint Find and fix problems in your JavaScript code.
- Biome One fast toolchain that formats and lints JavaScript, TypeScript, JSON, CSS, HTML, GraphQL, YAML and Markdown.
- XO Zero-config JavaScript and TypeScript linter built on ESLint
- ALE (Asynchronous Lint Engine) Asynchronous linting, fixing and LSP support for Vim and Neovim
- Stylelint A CSS linter that catches errors and enforces conventions in your stylesheets
- eslint-plugin-n Additional ESLint rules for Node.js
