@dnb-hugo/commitlint-config

Commitlint configuration used in dnb-hugo projects.

Usage no npm install needed!

<script type="module">
  import dnbHugoCommitlintConfig from 'https://cdn.skypack.dev/@dnb-hugo/commitlint-config';
</script>

README

lernaCodacy Badge

DNB-Hugo / commitlint-config

Commitlint configuration used in dnb-hugo projects.

Rules

This configuration extends on conventional-changelog/commitlint with the following changes:

  • Types are of one of: content, docs, feat, fix, layouts, refactor, test, chore, wip
  • Maximum line length is 100 characters

Setup

npm install --save-dev @dnb-hugo/commitlint-config

Then in package.json add the following lines:

{
  "scripts": {
    "commitlint": "commitlint --from=HEAD~1"
  }
}

Then add .commitlintrc.js with the following content:

module.exports = {
  "extends": [
    "@dnb-hugo/commitlint-config"
  ]
};

Lastly add a commit-msg hook to your git repository:

#!/bin/bash

npx --no-install commitlint --edit $1

Usage

If you set up the git hook for commit messages you are good to go. Every time you add a commit it will check the message and complain if it's not right.

You can always manually check a commit with npm run commitlint.

If you wish to check a particular commit, you can do so by running npm run commitlint -- $COMMITHASH.

Rules

... to be written ...

All configuration packages

Package Notes
browserslist-config Browserslist configuration used in dnb-hugo projects.
commitlint-config Commitlint configuration used in dnb-hugo projects.
eslint-config ESLint configuration used in dnb-hugo projects.
remark-config Remark configuration used in dnb-hugo projects.
standard-version-config Standard Version configuration used in dnb-hugo projects.
stylelint-config Stylelint configuration used in dnb-hugo projects.
textlint-config Textlint configuration used in dnb-hugo projects.