commitlint-plugin-loanmarket
v1.1.0
Published
<div align="center"> <img height="200" src="https://raw.githubusercontent.com/Gherciu/commitlint-jira/master/logo.png"> <h1>commitlint-loanmarket</h1> <p>commitlint-loanmarket checks if your commit messages meet the Jira conventional commit form
Downloads
1
Readme
Getting started.
Install dependencies
npm install --save-dev @commitlint/cli commitlint-plugin-loanmarket
Configure commitlint to use loanmarket commits messages style config
// commitlint.config.js
module.exports = {
plugins: ['commitlint-plugin-loanmarket'],
rules: {
"jira-task-id-match": [2, "always"],
"jira-subject-match": [2, "never"]
}
}
To lint commits before they are created you can use Husky's 'commit-msg' hook
// package.json
{
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
Rules
jira-task-id-match
- this rule check if commit message task id matches the jira id.
If this rule was set to always
refer below for the example
// ❌ Bad commit messages
git commit -m "My commit message body"
git commit -m ":My commit message body"
// ✅ Good commit messages
git commit -m "CRM-2121, CRM-21: My commit message body"
git commit -m "CRM-1234: My commit message body"
jira-subject-empty
- this rule check if subject should be empty
If this rule was set to never
refer below for the example
// ❌ Bad commit messages
git commit -m "CRM-123:"
// ✅ Good commit messages
git commit -m "CRM-2121, CRM-21: My commit message body"
git commit -m "CRM-1234: My commit message body"
Author
Authored and maintained by Junrill Galvez