1.2.0 • Published 3 years ago

@dlwlrma/commitlint-config v1.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

Commitlint Config Preset

HanJeaHwan NPM version NPM Downloads

Installation

yarn add @dlwlrma/commitlint-config --D

After installation create a file commitlint.config.js at project root and extend the config:

{
  "extends": ["@dlwlrma/commitlint-config"],
  "rules": {}
}

Usage

Example for enforce ticket reference at commit message body

{
  "extends": ["@dlwlrma/commitlint-config"],
  "rules": {
    "ticket-rule": [2, "always", ["TICKET-"]]
  }
}

Simply read the commitlint documentation and follow those instructions.

Git Hook

Setup pre-commit hook for linting commit message.

yarn add husky --D
npm install husky --save-dev

Update package.json

  "husky": {
    "hooks": {
      "commit-msg": "commitlint -e $HUSKY_GIT_PARAMS",
    }
  }