Skip to content

Instantly share code, notes, and snippets.

@RajvirS99
Last active June 20, 2022 08:18
Show Gist options
  • Save RajvirS99/769a2ce5726a76582cb68787cc011fd3 to your computer and use it in GitHub Desktop.
Save RajvirS99/769a2ce5726a76582cb68787cc011fd3 to your computer and use it in GitHub Desktop.
Install husky pre-commit in Node project

Configure Husky in these steps -

  1. Go to project directory using the command cd project_folder.
  2. open the terminal in the VS Code or open the terminal/command line from that directory
  3. Run the command npm install husky lint-staged -D

There you go, you can now see the package.json file. You will see the husky installed in devDependencies.

Test the project by committing. You will see Husky pre-commit will intiate before committing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment