@exile-watch/lefthook-config
Shared Lefthook configuration for exile.watch projects

Dedicated blog post: Leveraging Lefthook to enforce commit guidelines at exile.watch
This package contains shared Lefthook configuration, Lefthook dependency and commit-related dependencies.
About Lefthook
Lefthook is a Git hooks manager for Node.js, Ruby and many other types of projects.
Usage
Prerequisites
Install the package as a
devDependency
:
npm i -D @exile-watch/lefthook-config
Add/update following
config
andscripts
properties in repo's rootpackage.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"
}
}
}
Create a new configuration file at
./commitlint.config.js
and inherit all the options usingextends
property:
// {root}/commitlint.config.js
module.exports = {
extends: ['@commitlint/config-conventional']
};
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
Last updated
Was this helpful?