exile.watch docs
  • Introduction
  • The Maven - exile.watch context
  • Projects
    • hideout
    • crucible
      • Contributing
    • writ
      • Contributing
    • splinters
      • Contributing
      • @exile-watch/vite-config
      • @exile-watch/biome-config
      • @exile-watch/typescript-config
      • @exile-watch/unit-testing-config
      • @exile-watch/lefthook-config
    • nucleus
      • Contributing (data)
        • Encounter token breakdown
      • Contributing (scripts)
        • Scripts definition
      • @exile-watch/encounter-data
      • @exile-watch/seo
    • malachai
      • Contributing
      • snap gyazo thumbnail
    • doryani
      • Contributing
      • Actions
        • Authenticate to GitHub Package Registry
        • Install npm dependencies
        • Code quality assurance
        • Deploy webapp
        • Publish package
        • Preview publish package
        • Preview deploy webapp
  • voidstone
    • Contributing
  • Development
    • Commit message guidelines
    • Prerequisites
    • Generating GitHub PAT
    • .npmrc file
  • Architecture
    • Dependencies
    • Tech stack
    • Adoption chart
    • GHA workflows web
  • Legal
    • License - FSL, Apache 2.0
    • Non-Affiliation Notice
    • Code of Conduct
    • Privacy Policy
Powered by GitBook
On this page
  • About @exile-watch/lefthook-config
  • About Lefthook
  • Usage
  • Prerequisites

Was this helpful?

  1. Projects
  2. splinters

@exile-watch/lefthook-config

Shared Lefthook configuration for exile.watch projects

Previous@exile-watch/unit-testing-configNextnucleus

Last updated 2 days ago

Was this helpful?

Dedicated blog post:


About

This package contains shared Lefthook configuration, Lefthook dependency and commit-related dependencies.

About Lefthook

Usage

Prerequisites

  1. Add @exile-watch/typescript-config

  2. Add @exile-watch/biome-config


  1. Install the package as a devDependency:

npm i -D @exile-watch/lefthook-config

  1. Add/update following config and scripts properties in repo's root package.json:

// {root}/package.json
{
  "scripts": {
    "postinstall": "npx lefthook install",
    "lint": ...,        // "exit 0" if linting is not set
    "lint:apply": ...,  // "exit 0" if linting is not set
    "format": ...       // "exit 0" if formatting is not set
    "typecheck": ...    // "exit 0" if typecheck is not set
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }
}

  1. Create a new configuration file at ./commitlint.config.js and inherit all the options using extends property:

// {root}/commitlint.config.js
module.exports = {
  extends: ['@commitlint/config-conventional']
};

  1. In project root in lefthook.yml replace generated content with:

# {root}/lefthook.yml
remotes:
  - git_url: https://github.com/exile-watch/splinters
    configs:
      - packages/lefthook-config/lefthook.yml

is a Git hooks manager for Node.js, Ruby and many other types of projects.

Lefthook
Leveraging Lefthook to enforce commit guidelines at exile.watch
@exile-watch/lefthook-config
exile.watch logo