swords-and-ravens
swords-and-ravens copied to clipboard
Use prettier
https://prettier.io/docs/en/install.html
This can be done effectively using husky and the lint-staged module. It will auto-format staged files as part of the commit process. You can add a .prettierrc.js file to customize the format.
https://www.npmjs.com/package/husky https://www.npmjs.com/package/lint-staged
The only caveat is to use husky version 4, as version 5 (latest) has some ongoing licensing issues.
Because it auto-formats the entire file, it may be best to start using prettier with one large commit from running prettier across the entire codebase. That will ensure that future commits don't have formatting-based changes in PRs.