Skip to content

Latest commit

 

History

History
63 lines (40 loc) · 1.35 KB

HUSKY.md

File metadata and controls

63 lines (40 loc) · 1.35 KB

Husky configuration

The purpose of the husky is to run tasks on certain git actions. Initially it has been setup to run linting tasks on commit locally. This helps to ensure high standards and notify developers of failures soon.

It runs on changed files using pnpm --filter=[$LATEST_HASH]. As this is a clean project it is quite fast but as it grows we can consider running husky jobs only on push

Contents

Prerequisites

Setup

  • Add workspace reference to husky:

    pnpm add -w husky -D
  • Install husky:

    pnpm husky install
  • Add husky's install script:

    // package.json
    
    "scripts": {
      ...
      "prepare": "husky install"
      ...
    }
  • Add commit-msg hook for linting of commit message using commitlint:

    pnpm husky add .husky/commit-msg 'pnpm commitlint --edit $1'

Usage

  • Automatic execution of formating, linting, typechecking and commitlint on commit.
    In case of any failures, commit will be rejected.

License

MIT © Leather Wallet LLC


⬅ Back