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
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.
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
What is the difference between Prettier, StandardJS and ESLint?
I understand that Prettier is code formatter only, not linter but I don't understand well that how StandardJS is different from Prettier and how StandardsJS and ESlint are different. More on github.com
Eslint, Prettier and coc.nvim
Give ALE a try. I use it for eslint and rubocop and it works great.
More on reddit.comDo 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
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
Videos
13:38
Saying Goodbye To ESLINT and Prettier - YouTube
10:22
Prettier & ESLint in Visual Studio Code: The Ultimate Guide - YouTube
21:39
Using ESLint and Prettier in Visual Studio Code - YouTube
15:04
I Will Never Use Prettier or ESLint Again - YouTube
13:07
I Ditched Prettier and ESLint (Here's Why) - YouTube
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.
Top answer 1 of 21
106
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.
2 of 21
11
prettier does a better job, is faster, and can format more than js
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
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
Scinos
scinos.dev › posts › 2020-11-23-eslint-plus-prettier
Part I: ESLint + Prettier
November 23, 2020 - They seems to solve the same problem (but they don't) and certainly there is some overlap, but the goals are different. As the Prettier docs puts it: use Prettier to enforce a consistent formatting, use ESLint to catch bugs.
GitHub
github.com › prettier › prettier › issues › 2364
What is the difference between Prettier, StandardJS and ESLint? · Issue #2364 · prettier/prettier
April 16, 2017 - I understand that Prettier is code formatter only, not linter but I don't understand well that how StandardJS is different from Prettier and how StandardsJS and ESlint are different.
Published Jun 30, 2017
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
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; ...