File tree Expand file tree Collapse file tree 1 file changed +23
-17
lines changed Expand file tree Collapse file tree 1 file changed +23
-17
lines changed Original file line number Diff line number Diff line change @@ -205,28 +205,34 @@ should work with other solutions as well.
205205
206206#### Husky Example
207207
208+ > ℹ️ See [ Husky Documentation] ( https://typicode.github.io/husky/#/?id=usage ) for
209+ > more information
210+
2082111 . Install Husky
209212
210- > ⚠️ We're sticking with Husky 4 for now as 5+ has licensing restrictions for
211- > commercial projects and significantly changes how hooks are configured
213+ ``` bash
214+ yarn add -D husky
215+ ```
212216
213- ``` sh
214- yarn add -D ' husky@^4.3.8'
215- ```
217+ 2 . Add ` prepare ` script
216218
217- 2 . Configure hooks in ` package.json `
219+ ``` bash
220+ npm set-script prepare " husky install"
221+ ```
218222
219- ``` json
220- {
221- "name" : " my-package" ,
222- "husky" : {
223- "hooks" : {
224- "pre-commit" : " hover-scripts pre-commit" ,
225- "commit-msg" : " hover-scripts commit-msg"
226- }
227- }
228- }
229- ```
223+ 3 . Create hooks
224+
225+ i. 📂 ** .husky/pre-commit**
226+
227+ ``` bash
228+ yarn husky add .husky/pre-commit " yarn hover-scripts pre-commit"
229+ ```
230+
231+ ii. 📂 ** .husky/commit-msg**
232+
233+ ``` bash
234+ yarn husky add .husky/commit-msg " yarn hover-scripts commit-msg"
235+ ```
230236
231237## License
232238
You can’t perform that action at this time.
0 commit comments