@alexmarqs/commitlint-config
Shareable commitlint
config used in personal projects.
![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)
How to install
npm install -D @alexmarqs/commitlint-config @commitlint/cli
yarn add -D @alexmarqs/commitlint-config @commitlint/cli
Usage
After installing it, apply the config to commitlint
by running the following command:
echo "module.exports = { extends: ['@alexmarqs/commitlint-config'] };" > .commitlintrc.js
Husky integration
To lint commits before they are created you can use install Husky and use the commit-msg
hook:
npm install husky -D
yarn add husky -D
npx husky install
yarn husky install
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit "$1"'
yarn husky add .husky/commit-msg 'yarn commitlint --edit $1'
For version 4 and under of Husky use the following instructions instead in your package.json
:
{
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
License
MIT License © alexmarqs