Because Prettier generally does a better job of formatting than ESLint. This is for three reasons: It's really fast, particularly in comparison to ESLint. Prettier is designed to format documents and that's it, which means it can be a lot simpler than ESLint, at least architecturally, especially as there's relatively little in the way of plugins. So if you just need to format your code quickly in one chunk, Prettier is the way to go. Prettier is already preconfigured, so it's also usually quicker to get started with. ESLint has some default formatting rules IIRC, but relatively minimal ones. To ensure every detail is formatted the same way, you need to put a lot of effort into configuring ESLint, which most people don't really want to do. Related: Conceptually, Prettier formats holistically, which is to say, it takes a whole document and applies its formatting to every single syntax node - generally, this means that you get very close to having exactly one valid output, no matter how the input file is formatted. ESLint, on the other hand, not only requires each formatting rule to be configured individually, but also applies them generally individually, so it's easier to have cases where you can get inconsistent behaviour depending on the original formatting of the file. Answer from MrJohz on reddit.com
🌐
Reddit
reddit.com › r/node › why use prettier if eslint can format?
r/node on Reddit: Why use prettier if ESLint can format?
July 27, 2022 -

I've heard ESLint can format but I haven't found a clear answer why it seems prettier is used instead of the ESLint formatter. Whenever I try to look it up most comments neglect to mention that ESLint can also format so it's not obvious why prettier would be needed at all.

🌐
Better Stack
betterstack.com › community › guides › scaling-nodejs › prettier-vs-eslint
Prettier vs ESLint: Choosing the Right Tool for Code Quality | Better Stack Community
April 17, 2025 - Prettier is the go-to code formatter, focusing exclusively on code style and formatting. It takes and rewrites your code according to a consistent style, removing debates about formatting preferences from your development process.
Discussions

What's the difference between prettier-eslint, eslint-plugin-prettier and eslint-config-prettier?
I want to use Prettier and ESLint together, but I experienced some conflicts just by using them one after another. I see that there are these three packages that seem to allow them to be used in ta... More on stackoverflow.com
🌐 stackoverflow.com
Do you use eslint and/or prettier?
Eslint and Prettier try to solve different problems . Altough Eslint can be used to format code, its not built specifically for this, and formatting plugins can only do so much. You can use both Eslint and Prettier if you care greatly about both linting and code formatting. Prettier has a plugin to disable Eslint's formatting rules. More on reddit.com
🌐 r/webdev
2
2
May 4, 2022
Eslint, Prettier and coc.nvim

Give ALE a try. I use it for eslint and rubocop and it works great.

More on reddit.com
🌐 r/vim
8
10
January 30, 2019
Why use prettier if ESLint can format?
Because Prettier generally does a better job of formatting than ESLint. This is for three reasons: It's really fast, particularly in comparison to ESLint. Prettier is designed to format documents and that's it, which means it can be a lot simpler than ESLint, at least architecturally, especially as there's relatively little in the way of plugins. So if you just need to format your code quickly in one chunk, Prettier is the way to go. Prettier is already preconfigured, so it's also usually quicker to get started with. ESLint has some default formatting rules IIRC, but relatively minimal ones. To ensure every detail is formatted the same way, you need to put a lot of effort into configuring ESLint, which most people don't really want to do. Related: Conceptually, Prettier formats holistically, which is to say, it takes a whole document and applies its formatting to every single syntax node - generally, this means that you get very close to having exactly one valid output, no matter how the input file is formatted. ESLint, on the other hand, not only requires each formatting rule to be configured individually, but also applies them generally individually, so it's easier to have cases where you can get inconsistent behaviour depending on the original formatting of the file. More on reddit.com
🌐 r/node
55
88
July 27, 2022
People also ask

What is ESLint used for?
ESLint analyzes code for potential errors, enforces coding standards, and improves overall code quality. It helps catch issues like unused variables, improper syntax, and bad logic before they cause problems in development or production.
🌐
dhiwise.com
dhiwise.com › post › eslint-vs-prettier-choosing-the-best-tool
ESLint vs. Prettier: Choosing the Best Tool
What is the difference between linting and Prettier?
Linting involves analyzing code to find logical errors and enforce coding rules, typically using tools like ESLint. Prettier, on the other hand, is a formatter that ensures code looks consistent by adjusting indentation, spacing, and style without checking for logic or bugs.
🌐
dhiwise.com
dhiwise.com › post › eslint-vs-prettier-choosing-the-best-tool
ESLint vs. Prettier: Choosing the Best Tool
🌐
Hacker News
news.ycombinator.com › item
The debate for me is now eslint —-fix or prettier. I don’t get why people need m... | Hacker News
February 22, 2024 - git blame a1b2c4 -- foo.js Where a1b2c4 is the commit hash. Could even tag the commit to make it more convenient: · git tag beforeRefmt a1b2c4 git blame beforeRefmt —- foo.js and push the tag up for everyone to have access to it
Top answer
1 of 2
456

UPDATE 2023: ESLint is deprecating formatting rules and recommend you use a source code formatter instead.

tl;dr: Use eslint-config-prettier in eslint, and run prettier separately. You can ignore the rest.

From v8.53.0 onwards, you will see a deprecation warning if those formatting rules are enabled in your config. You should still use eslint-config-prettier to disable conflicting rules until the rules are removed in a new major release.

ESLint contains many rules and those that are formatting-related might conflict with Prettier, such as arrow-parens, space-before-function-paren, etc. Hence using them together will cause some issues. The following tools have been created to use ESLint and Prettier together.

prettier-eslint eslint-plugin-prettier eslint-config-prettier
What it is A JavaScript module exporting a single function. An ESLint plugin. An ESLint configuration.
What it does Runs the code (string) through prettier then eslint --fix. The output is also a string. Plugins usually contain implementations for additional rules that ESLint will check for. This plugin uses Prettier under the hood and will raise ESLint errors when your code differs from Prettier's expected output. This config turns off formatting-related rules that might conflict with Prettier, allowing you to use Prettier with other ESLint configs like eslint-config-airbnb.
How to use it Either calling the function in your code or via prettier-eslint-cli if you prefer the command line. Add it to your .eslintrc. Add it to your .eslintrc.
Is the final output Prettier compliant? Depends on your ESLint config Yes Yes
Do you need to run prettier command separately? No No Yes
Do you need to use anything else? No You may want to turn off conflicting rules using eslint-config-prettier. No

For more information, refer to the official Prettier docs.

It's the recommended practice to let Prettier handle formatting and ESLint for non-formatting issues, prettier-eslint is not in the same direction as that practice, hence prettier-eslint is not recommended anymore. You can use eslint-plugin-prettier and eslint-config-prettier together.

2 of 2
3
  • Use eslint-config-prettier to turn-off eslint rules that are unnecessary or might conflict with Prettier. See 1st line in readme: eslint-config-prettier.
  • Use eslint-plugin-prettier to run Prettier as an Eslint-rule. See 1st line in readme: eslint-plugin-prettier
  • Use both to take advantage of both tools. See recommended configuration: eslint-plugin-prettier. This way you use plugin to run Prettier as an Eslint-rule, and config to turn-off eslint rules that are unnecessary or might conflict with Prettier.
  • You can ignore prettier-eslint
🌐
Ben Ilegbodu
benmvp.com › blog › prettier-eslint
Prettier + ESLint = ❤️ | Ben Ilegbodu
January 31, 2021 - Prettier is a highly-opinionated code formatter intended to remove discussions about code style in code reviews. By default, we run prettier --write by itself and it formats our code. But if you also have ESLint (a JavaScript linter) in your tool chain, things can get tricky.
Find elsewhere
🌐
DhiWise
dhiwise.com › post › eslint-vs-prettier-choosing-the-best-tool
ESLint vs. Prettier: Choosing the Best Tool
May 13, 2025 - Prettier is an opinionated code formatter that formats your code using predefined rules. Unlike ESLint, it doesn’t care about logic errors—it focuses solely on code formatting to maintain a consistent style.
🌐
DEV Community
dev.to › patarapolw › eslint-vs-prettier-vs-editorconfig-or-just-use-everything-1da7
eslint vs prettier vs editorconfig, or just use everything? - DEV Community
June 2, 2020 - Eslint is a linter for your code, it looks for errors. Prettier is a code formatter, it doesn't look for errors.
🌐
React
react.dev › learn › editor-setup
Editor Setup – React
We recommend disabling all formatting rules in your ESLint preset using eslint-config-prettier so that ESLint is only used for catching logical mistakes.
🌐
HackerNoon
hackernoon.com › why-the-hell-do-people-confuse-prettier-with-eslint
Why the Hell Do People Confuse Prettier With Eslint? | HackerNoon
June 8, 2023 - Clearing up the confusion between Prettier and ESLint. Prettier tidies code, ESLint ensures quality. Use both wisely!
🌐
Reddit
reddit.com › r/webdev › do you use eslint and/or prettier?
r/webdev on Reddit: Do you use eslint and/or prettier?
May 4, 2022 -

If you use prettier and eslint, prettier rules have higher priority than eslint. So you'll end up ignoring a lot of eslint rules. Eslint can also auto-format code on save. That's pretty much the reason I only use eslint.

Then I came to realize that it probably shouldn't matter if some eslint rules gets ignored by prettier as long as the styling in the entire codebase is consistent.

EDIT: I know that there's a plugin when using prettier and eslint. That plugin disables eslint rules that will conflict with the prettier therefore you're not using eslint at 100%, I might as well just use prettier alone or is there a difference?

🌐
Luke Deniston
lukedeniston.com › eslint-prettier
You Probably *Do* Need ESLint-Prettier – Luke Deniston
February 24, 2024 - Our brains love that. We’re just fancy pattern matchers and if a pattern doesn’t exist we invent one. So all those rules that ESLint follows we call linting and the ones that Prettier follows we call formatting.
🌐
Josh Finnie
joshfinnie.com › blog › adding-eslint-and-prettier-to-my-blog
Adding ESLint & Prettier to My Blog | www.joshfinnie.com
December 2, 2024 - ESLint’s plugin architecture allows customization for any project. It works with frameworks like Astro and integrates with tools like Prettier. While Prettier handles formatting, ESLint focuses on code logic and structure.
🌐
DEV Community
dev.to › lovestaco › eslint-vs-prettier-the-great-debate-for-your-codebase-546m
ESLint vs Prettier: The Great Debate for Your Codebase - DEV Community
January 15, 2025 - ESLint is Sherlock Holmes: it’ll catch that sneaky unused variable or accidental global scope declaration. Prettier is Marie Kondo: it’ll declutter your code but doesn’t care if there’s a bug.
🌐
Mario Fernandez
hceris.com › replacing eslint with prettier
Replacing ESLint with prettier | Mario Fernandez
August 29, 2018 - I've started using Prettier for formatting my code. ESLint is now purely a linter. Both of them work together beautifully
🌐
Prettier
prettier.io › docs › comparison
Prettier vs. Linters · Prettier
In other words, use Prettier for formatting and linters for catching bugs! How does it compare to ESLint/TSLint/stylelint, etc.?
🌐
yield code();
yieldcode.blog › post › farewell-rust
Farewell, Rust - Dmitry Kudryavtsev
3 weeks ago - The never-ending deprecation of cjs in favor of esm; it’s mostly good, until you encounter a cjs package, and then it’s hell. The cumbersome eslint and prettier setup where you need to juggle between 2 files and dozen of plugins to get basic functionality you get with clippy out-of-the-box; ...
🌐
StackShare
stackshare.io › stackups › eslint-vs-prettier
ESLint vs Prettier | What are the differences? | StackShare
Prettier - Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
VS Code Prettier ESLint
Extension for Visual Studio Code - A Visual Studio Extension to format JavaScript and Typescript code using prettier-eslint package
🌐
Medium
medium.com › @daveed_kz › eslint-and-prettier-battle-for-supremacy-f2657c9cf950
Solving ESLint and Prettier’s battle for supremacy. | by David Kezi | Medium
May 20, 2018 - The thing is Prettier does it so much better while ESLint deals with code quality and patterns that prettier doesn’t care about.