Conventional commits

Set up conventional commit to create explicit commit history

Install the dependencies

npm install -D @commitlint/config-conventional @commitlint/cli

Create .commitlintrc.js at root with

module.exports = {extends: ['@commitlint/config-conventional']};

Add commitlint in your commit hooks. For example in husky:

"husky": {
  "hooks": {
    "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
    "pre-commit": "lint-staged"
  }
}