Configuration to Continue Using husky v4 Without Upgrading to husky v5

Tadashi Shigeoka ·  Sat, February 20, 2021

I’ll share what I configured to continue using husky 4 without upgrading to husky 5.

npm

Background: husky v5 Requires Sponsorship for Commercial Use

You're viewing documentation for husky v5, which is free to use in Open Source projects ❤️ and in early access for Sponsors 🔑.

To use this new version at work, you can become a sponsor on GitHub Sponsors or Open Collective (monthly or yearly donations are supported).

If you can’t sponsor Husky, that’s okay, husky v4 is free to use in any project. During the early access, v4 will continue to receive maintenance updates.

After the early access, husky v5 will be MIT again.

📖 Source: typicode/husky: Git hooks made easy 🐶 woof!

Since it says “After the early access, husky v5 will be MIT again,” I decided to continue using husky v4 until husky v5 becomes MIT licensed.

Why Not Become a husky v5 Sponsor?

Since I’m using it in client work (contract development) projects, I decided to continue using husky v4 considering the possibility that client companies might not be able to become sponsors after delivery.

For in-house product development, I’m actively considering OSS donations and sponsorships.

What I Did to Continue Using husky v4

Here are the two things I did to continue using husky v4.3.8 (latest v4 version at time of writing):

  • npm update to latest husky 4.x version
  • Ignore husky 5.x updates with dependabot

npm install --save-dev husky@4

npm install husky@4 --save-dev

Ignore husky v5.x Updates with dependabot

If you’re using Dependabot on GitHub, add a setting to ignore husky versions: [“5.x”] as follows:

# .github/dependabot.yml
version: 2
updates:
  - package-ecosystem: npm
    directory: '/'
    ignore:
      - dependency-name: "husky"
        # For husky, ignore all updates for version 5
        versions: ["5.x"]

That’s all from configuring projects that can’t upgrade to husky v5 to continue using husky v4 from the Gemba.