An ESLint plugin that executes Prettier during linting and surfaces formatting mismatches as individual ESLint issues, with optional autofix via eslint --fix.
Overview
eslint-plugin-prettier bridges Prettier and ESLint by registering Prettier as an ESLint rule. When you lint a project, the plugin compares your code to Prettier's output and reports each difference as its own ESLint diagnostic, so formatting problems appear alongside other lint feedback in editors and CI.
You install the plugin alongside your own ESLint and Prettier installations. It ships recommended presets for both legacy .eslintrc and flat eslint.config.js setups; those presets enable the prettier/prettier rule, turn off arrow-body-style and prefer-arrow-callback because they can conflict, and pull in eslint-config-prettier to disable other formatting-related ESLint rules.
The prettier/prettier rule is autofixable when you run ESLint with --fix, applying Prettier's formatting in that pass. Optional rule settings can pass Prettier options, though keeping Prettier options in .prettierrc helps editor extensions stay aligned. Line-ending mismatches follow Prettier's behavior; configuring endOfLine in Prettier or normalizing files avoids repeated cr/lf reports on Windows.
For Svelte, the maintainers recommend eslint-plugin-svelte rather than svelte3 integration because modified Svelte text can be ignored. If Prettier's opinionated output is not what you want, use prettier-eslint instead of this plugin.
Key features
- Prettier executed as an ESLint rule
- Per-difference ESLint diagnostics
- Autofix through eslint --fix
- Legacy and flat recommended configs
- Integrates eslint-config-prettier preset
- Optional Prettier options in rule config
- Svelte guidance with eslint-plugin-svelte
Use cases
- Single lint pass for bugs and formatting
- CI failing on Prettier drift via ESLint
- Editor ESLint integration for format fixes
- Disabling conflicting ESLint style rules
- Large unformatted codebases with temporary rule toggles