Skip to content

ivangabriele/commitlint-config

Repository files navigation

My CommitLint Configuration

MIT License GitHub Check Workflow Status npm

My most commonly used CommitLint configuration.



Usage

Run:

npm i -DE @commitlint/cli @ivangabriele/commitlint-config husky lint-staged

or:

yarn add -DE @commitlint/cli @ivangabriele/commitlint-config husky lint-staged

Create /.husky/commit-msg:

[ -n "$CI" ] && exit 0

yarn commitlint --edit "$1"

Create /.husky/pre-commit:

[ -n "$CI" ] && exit 0

yarn lint-staged

Give them execution rights:

chmod +x .husky/commit-msg .husky/pre-commit

Create /.commitlintrc:

{
  "$schema": "https://json.schemastore.org/commitlintrc",
  "extends": ["@ivangabriele/commitlint-config"]
}

Update /package.json:

{
  // ...
  "scripts": {
    // ...
    "prepare": "husky"
    // ...
  }
  // ...
}

Contribute

Please refer to the contribution guidelines for information on how to contribute to this project.