@dan-nz/commitlint-config

1.0.0 • Public • Published

commitlint-config

This package includes the shareable commitlint configuration used by Digital Arts Network New Zealand.

Installation

npm i --save-dev @commitlint/cli @dan-nz/commitlint-config

Note: for monorepos perform these steps at the root of your package.

Usage

Create an commitlint.config.js file with the following contents:

module.exports = {
  extends: [
    '@dan-nz/commitlint-config'
  ],
}

Install husky

npm i --save-dev husky

Add a husky hook to package.json

This will be executed whenever a new commit is created.

// package.json
{
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  }
}

Install commitizen prompt

npm i --save-dev commitizen cz-conventional-changelog

Add Commitizen adapter config

// package.json
{
  "config": {
    "commitizen": {
      "path": "cz-conventional-changelog"
    }
  }
}

Add a script pointing to Commitizen cli

// package.json
{
  "scripts": {
    "commit": "git-cz"
  }
}

To start a commit, run npm run commit instead of the usual git commit.

Related

Package Sidebar

Install

npm i @dan-nz/commitlint-config

Weekly Downloads

6

Version

1.0.0

License

MIT

Unpacked Size

5.09 kB

Total Files

4

Last publish

Collaborators

  • dan_logins
  • gmlnchv
  • glenndwright