I recommend using VS Code and installing the following extensions for this workshop, but feel free to use your favorite code editor ( sublime ... ).
Husky lets us run commands or script before committing or pushing our code to git, its very useful to To stupe some pre-commit hook easily, we are going to use it to run Eslint and Prettier to validate our commit. We can use the power of pre-commit to Make sure our commit messages meet the conventional commit format.
yarn add husky lint-staged @commitlint/config-conventional @commitlint/cli -D
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
package.json
"scripts": {
"prepare": "husky install"
}
"lint-staged": {
"*.{js,jsx,tsx}": "eslint"
}
#init husky
npx husky init
npx husky add .husky/commit-msg 'yarn commitlint --edit "$1"'
npx husky add .husky/pre-commit "yarn lint"
Some Npm script to be added to your package.json
"clean:android": "cd android && ./gradlew cleanBuildCache && ./gradlew clean && cd ..",
"clean:ios": "rm -rf ios/build",
"clean": "run-p clean:*",
"setup:ios": "cd ios && pod install --repo-update && cd ..",
Make sure to install npm-run-all as Dev deps
👉 https://github.com/yjose/Tasker/commit/196b94dde797f3ee480a6ab54fc5289c72f881bd