Whether you work in a team or by yourself, having consistently formatted code is important for readability and maintainability. Tl;drUse Prettier to automatically format your JavaScript and use husky and lint-staged to add a precommit script that runs Prettier and your tests when you commit. Check out the full code: