Prettier vs ESLint
People think Prettier and ESLint do the same job, and they do not. Prettier only changes how code looks: the spaces, the quotes and the line breaks. ESLint looks for code that may be wrong, like a name you set but never use. Most teams run both. Prettier sets the look, and ESLint hunts for bugs.
Prettier
A free tool that tidies the layout of code. It works on JavaScript, CSS, HTML and more.
Prettier is a free tool that sets the layout of your code for you. It works on JavaScript, TypeScript, CSS, HTML, JSON, Markdown, YAML and more. It reads your code, throws away your spacing, and prints it again in one fixed style. It has very few settings on purpose, so a team stops arguing about tabs and quotes. Most people run it each time they save a file.
ESLint
A free tool that checks JavaScript code for slips. It does not run the code.
ESLint is a free linter for JavaScript and TypeScript. It reads your code without running it and points out problems. It finds things like a variable you never use, or code that can never run. Each check is a rule, and you turn rules on or off in a file called eslint.config.js. Many problems it can fix by itself.
In one line
- Prettier
- A free tool that tidies the layout of code. It works on JavaScript, CSS, HTML and more.
- ESLint
- A free tool that checks JavaScript code for slips. It does not run the code.