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 ciThis 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 commitWe 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 generateThis will create/edit all files for the NewHook:
src
├─hooks
│   └─hook
│       ├─useHook.ts
│       ├─useHook.spec.ts
├─index.tsTest
All Easy Hooks have tests. To execute it for just one component, you can run:
$ npm test /path/to/your/componentWhen 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 testGit Hooks
We have two hooks inside Yoga repo:
- pre-commit: run eslint on all repo
- pre-push: run- npm test