DEV Community

amiceli
amiceli

Posted on

1

My script to install husky, commitlint and lint-staged with zx

Hello friends,

In all my projects I use husky, lint-staged and commitlint.

Husky

I love husky ! It helps to create Git hook. I use it for :

  • run eslint with lint-staged before commit
  • commitlint to follow conventionnal commits rules
  • run unit tests before push

lint-staged

lint-staged is useful to run eslint against staged git files.
I love it, with lint-staged your commits contain nice files ;). It's better than one commit called lint all files after all commits ^^.

commitlint

commitlint checks if your commit messages meet the conventionnal commit format.
I discovered conventionnal commit in my company and know I use it in any projects ;).

It's especially useful when we are many developers in a project. It's better than commit like job done, fix something etc ^^.

Installation

To install everything on my projects I create a zx script in my zx-scripts repository.

If you want test it, you can run this script withzx :

zx https://raw.githubusercontent.com/amiceli/zx-scripts/main/index.mjs
Enter fullscreen mode Exit fullscreen mode

If you don't have zx, you can install it with npm : npm i -g zx.

I'm still wording on it to add some args and eslint install.

Ciao friends !

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay