@web-bee-ru/commitlint-config

2.0.1 • Public • Published

@web-bee-ru/commitlint-config

Configurable commitlint config used by https://web-bee.ru/.

Install

# npm
npm i -D @web-bee-ru/commitlint-config @commitlint/cli

Configure

After installing it, add commitlint.config.js into root of your project:

// commitlint.config.js
const makeConfig = require("@web-bee-ru/commitlint-config");

module.exports = makeConfig({
  // @NOTE: uncomment to override defaults:
  // commitTypes: [
  //   "feat", // @NOTE: implementation of functionality
  //   "fix", // @NOTE: bugfix
  //   "wip", // @NOTE: work in progress
  //   "ci", // @NOTE: continuous integration related issues
  //   "chore", // @NOTE: should be moved in the starter-project
  // ],
});

Automate

To lint commits before they are created, install Husky and use the 'commit-msg' hook.

# Npm
npm i -D husky@7

husky v6/v7

Initialize husky

# Npm
npx husky-init

Add script to package.json

{
  "scripts": {
    "prepare": "husky install"
  }
}

Create .husky/commit-msg hook file

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint --edit $1

husky v4 (legacy)

You can create a .huskyrc file or add to your package.json the following code for

{
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @web-bee-ru/commitlint-config

Weekly Downloads

2

Version

2.0.1

License

ISC

Unpacked Size

14 kB

Total Files

20

Last publish

Collaborators

  • denwa799
  • simplesmiler
  • crutch12
  • gleam-ru
  • devirek