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 !

Speedy emails, satisfied customers

Postmark Image

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

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

Okay