@strv/commitlint-config
STRV's config for commitlint
Configurations
@strv/commitlint-config
(default config)
Suitable for all projects.
@strv/commitlint-config/lerna
Suitable for projects structured as a Lerna-managed monorepo. In addition to the standard conventional commits ruleset, it checks the scope to match a package name managed by Lerna.
Usage
Installation
npm i --dev @commitlint/cli @strv/commitlint-config
Configuration
Create a commitlint.config.js file with the following contents:
'use strict'
module.exports = {
extends: [
'@strv/commitlint-config',
'@strv/commitlint-config/lerna',
],
}
Linting
Install a git hook into .git/hooks/commit-msg with the following contents:
#!/bin/sh
./node_modules/.bin/commitlint < "$1"
If your project uses make
you can use the following process to automatically install the git hooks upon each invocation of make
with no target.
GITFILES := $(patsubst utils/githooks/%, .git/hooks/%, $(wildcard utils/githooks/*))
all: githooks
githooks: $(GITFILES)
.git/hooks/%: utils/githooks/%
cp $< $@
License
See the LICENSE file for information.