@dnb-org/commitlint-config

Commitlint configuration for in dnb-org projects.

Usage no npm install needed!

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

README

@dnb-org/commitlint-config

Commitlint configuration used in dnb-org projects.

Installation

Use npm to install this package as development dependency:

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

Configuration

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-org/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-org/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 ...

DNB-Org/Configurations

A collection of configurations for website development at DNB Org.

Package Description
babel-config Babel configuration
bootstrap-config Bootstrap configuration
browserslist-config Browserslist configuration
commitlint-config Commitlint configuration
cssnano-config CSSnano configuration
cypress-config Cypress configuration
eslint-config ESLint configuration
postcss-config PostCSS configuration
prettier-config Prettier configuration
remark-config ReMark configuration
standard-version-config Standard Version configuration
stylelint-config StyleLint configuration
textlint-config TextLint configuration
webpack-config Webpack configuration
tools Tools