Eslint is a linter for your code, it looks for errors.
Prettier is a code formatter, it doesn't look for errors. It makes your code looks "formatted" across the entire codebase.
Editor config may be using eslint + prettier under the hood.
For example, on your code editor you just use the regular editor config (which uses prettier and eslint under the hood). You could create a npm script that run eslint and prettier before pushing to a repo for example.
husky would help you to achieve this. It adds hooks to your developer environment to run certain scripts when something happens. On this case: "When I run git push do npm run estlint-prettier".
I personally use ESLint. It covers the code style, and you have a wide variety of options (and plugins + their options) to customize what you want. This works fine for me as I have it fix my code on save.
I prefer prettier and editorconfig as both of them doesn't need much thought and set rules for us. Coming to eslint, I have to use in company projects, but for personal projects I don't add this extra thing
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Top comments (3)
Everything I would say.
Eslint is a linter for your code, it looks for errors.
Prettier is a code formatter, it doesn't look for errors. It makes your code looks "formatted" across the entire codebase.
Editor config may be using eslint + prettier under the hood.
For example, on your code editor you just use the regular editor config (which uses prettier and eslint under the hood). You could create a npm script that run
eslint and prettierbefore pushing to a repo for example.husky would help you to achieve this. It adds hooks to your developer environment to run certain scripts when something happens. On this case: "When I run git push do npm run estlint-prettier".
I personally use ESLint. It covers the code style, and you have a wide variety of options (and plugins + their options) to customize what you want. This works fine for me as I have it fix my code on save.
I prefer prettier and editorconfig as both of them doesn't need much thought and set rules for us. Coming to eslint, I have to use in company projects, but for personal projects I don't add this extra thing