Contributing
First of all, make sure you have all settings up for Easy hooks to run it locally:
- Fork and clone this repo (opens in a new tab)
- Install dependencies using:
$ npm ci
This project follows the conventional-commit (opens in a new tab) pattern and, to help you with it, we use commitizen (opens in a new tab). So, everytime you want to commit some change, please use:
$ npm run commit
We usually follow the {{feat|fix|doc|ci}}/{{what-am-i-doing}}
for branch names.
New Custom Hook
At Easy Hooks, a Custom Hook isn't just one file. It has its own tests, exports, and so on. To make it easy, there is a script at the root:
$ npm run generate
This will create/edit all files for the NewHook:
src
├─hooks
│ └─hook
│ ├─useHook.ts
│ ├─useHook.spec.ts
├─index.ts
Test
All Easy Hooks have tests. To execute it for just one component, you can run:
$ npm test /path/to/your/component
When you finish the development of your custom hook, don't forget to add its tests!
Before pushing your changes, certify all tests are passing, running:
$ npm test
Git Hooks
We have two hooks inside Yoga repo:
pre-commit
: run eslint on all repopre-push
: runnpm test