I'm a happy prettier user to keep my CSS and JavaScript files consistent. However, it's hard to keep the discipline to run Prettier before every commit. This week I decided to automate the process with Husky and lint-staged.

There's also an updated version of this post that uses husky and lint-staged to set up PHP CS Fixer.

As an aside, this is what our .prettierrc generally looks like in Spatie projects: