Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

husky-commitlint-demo

Demo of how to lint Git commit messages with commitlint and husky. Read blog post or watch YouTube video.

Prerequisites

Install

Clone repository:

$ git clone https://github.com/remarkablemark/husky-commitlint-demo.git
$ cd husky-commitlint-demo

Install dependencies:

$ npm install

husky

Enable Git hooks:

$ npx husky install

Add the commit-msg hook:

$ npx husky add .husky/commit-msg 'npx commitlint --edit $1'

Uninstall husky:

$ npm uninstall husky

package.json

Private package:

{
  "private": true,
  "scripts": {
    "postinstall": "husky install"
  },
  "devDependencies": {
    "@commitlint/cli": "^11.0.0",
    "@commitlint/config-conventional": "^11.0.0",
    "husky": "^5.0.9"
  }
}

Public package:

{
  "private": false,
  "scripts": {
    "postinstall": "husky install",
    "prepublishOnly": "pinst --disable",
    "postpublish": "pinst --enable"
  },
  "devDependencies": {
    "@commitlint/cli": "^11.0.0",
    "@commitlint/config-conventional": "^11.0.0",
    "husky": "^5.0.9",
    "pinst": "^2.1.4"
  }
}

License

MIT

About

Demo of how to lint Git commit messages with commitlint and husky.

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages