DEV Community

Discussion on: eslint vs prettier vs editorconfig, or just use everything?

Collapse
 
rffaguiar profile image
Renan Aguiar

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 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".