ESLint with Prettier Setup
Basically, when using Prettier, all ESLint styling rules should be disabled.
This can be done with eslint-config-prettier.
.eslintrc.js example below.
prettier.config.js you can use anything you want (see example below).
Now the tricky part is how to run them...
Usually ESLint should run first, then Prettier.
That way any code changes by ESLint will be pass through Prettier as well.
Only use the opposite if you want ESLint to re-format something the conflicts with Prettier formatting.
package.json example below:
husky- Sets up git hooks when you
npm install, in this case a
lint-staged- Allows to run commands only on staged files/chunks in Git (i.e. only what you
Also, if you currently have styling rules in
.eslintrc.js, you'll need to remove them.
How to find them?
Use the eslint-config-prettier - cli-helper-tool.