@lmc-eu/commitlint-config
LMC's config for commitlint
Configurations
@lmc-eu/commitlint-config
(default config)
Suitable for all projects.
Usage
Installation
npm i --dev @commitlint/cli @lmc-eu/commitlint-config
Configuration
Create a .commitlintrc.js file with the following contents:
'use strict';
module.exports = {
extends: ['@lmc-eu/commitlint-config'],
};
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 $< $@
Or if you use husky place a git hook into .huskyrc.json with the following content:
{
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}