When you commit changes to the repository, use a pre-commit hook to ensure the formatting of the files is consistent based on a .prettierrc.json file. Some files, such as our .handlebars model output files, are in the .prettierignore file so they are not formatted.
Tasks
[X] Add prettier as a dev dependency
[X] Add husky as a dev dependency
[X] Setup the pre-commit hook to prettier format changed files
Purpose
When you commit changes to the repository, use a pre-commit hook to ensure the formatting of the files is consistent based on a
.prettierrc.json
file. Some files, such as our.handlebars
model output files, are in the.prettierignore
file so they are not formatted.Tasks
prettier
as a dev dependencyhusky
as a dev dependencyVerify
Before
After