Tools & Scripts

I recommend using VS Code and installing the following extensions for this workshop, but feel free to use your favorite code editor ( sublime ... ).

Setup Husky pre-commit hook with ESLint.

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.

  • Install Deps :
yarn add husky lint-staged @commitlint/config-conventional @commitlint/cli -D
  • Configure commitlint to use conventional config (optional)
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
  • Add the following code to your package.json
"scripts": {
    "prepare": "husky install"
  }

"lint-staged": {
    "*.{js,jsx,tsx}": "eslint"
  }
  • Run the following commands to init husky
#init husky
npx husky init

npx husky add .husky/commit-msg 'yarn commitlint --edit "$1"'

npx husky add .husky/pre-commit "yarn lint"

Useful npm scripts

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

Husky

Conventional commits

← Getting StartedFolder Structure →