Skip to content

Commit 1830b72

Browse files
committed
Update README to include instructions for prettier formatting in git hook
1 parent bdb2d2c commit 1830b72

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,19 @@ are using it within `package.json` simply write `typescript-scripts [script name
3939

4040
Formats all the files in the repository using prettier.
4141

42+
If you would like to run prettier automatically as a pre-commit hook on staged files then:
43+
44+
1. `npm install --save-dev husky`
45+
2. Add this to your package.json:
46+
47+
```json
48+
"husky": {
49+
"hooks": {
50+
"pre-commit": "pretty-quick --staged"
51+
}
52+
}
53+
```
54+
4255
TODO - allow passing an argument to configure which files/folders should be formatted
4356

4457
- compile (TODO)

0 commit comments

Comments
 (0)