Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/danieljancar/husky-demo

A simple demo on using husky as a Git hook on your codebase. 🐺🐾
https://github.com/danieljancar/husky-demo

cicd codebase git-hooks husky

Last synced: about 2 months ago
JSON representation

A simple demo on using husky as a Git hook on your codebase. 🐺🐾

Awesome Lists containing this project

README

        


Husky Demo


Simple integration of Husky for pre-commit hooks, linting, and formatting. Showcased in a simple Angular project.


---

## Getting Started

### Prerequisites

- [Node.js](https://nodejs.org/en/)
- [Angular CLI](https://cli.angular.io/)

## Setting up Husky

### Install Husky

```bash
npm install --save-dev husky
npx husky install
```

### Add pre-commit hook

```bash
npx husky add .husky/pre-commit "npm run lint"
```

## Result

When trying to commit, the pre-commit hook will build, test and lint the code. If there are any errors, the commit will be aborted.


Husky commit hook

## References

- [Presentation TechTalk](static/Husky%20Techtalk.pptx)
- [Youtube video from Angular Nation](https://www.youtube.com/watch?v=FvfAXG92UqY&ab_channel=AngularNation)