Skip to content

Latest commit

 

History

52 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@dnd-mapp/config-commitlint

push main npm version license

Shared commitlint config that extends @commitlint/config-conventional, which enforces Conventional Commits.

Requirements

  • @commitlint/cli 21 is a peer dependency and must be installed in your project.

Installation

pnpm add --save-dev @commitlint/cli @dnd-mapp/config-commitlint

Usage

Re-export the config from a commitlint.config.js file in your project root.

export { default } from '@dnd-mapp/config-commitlint';

To add your own rules, spread the config into your own.

import config from '@dnd-mapp/config-commitlint';

export default {
    ...config,
    rules: {
        ...config.rules,
        'scope-enum': [2, 'always', ['api', 'web']],
    },
};

The config ships with type declarations. It is typed as a commitlint UserConfig, so it works in a commitlint.config.ts file.

Rules

The config uses every rule from @commitlint/config-conventional with two changes.

Rule Setting Reason
header-max-length 72 Keeps subject lines readable in git log
body-max-line-length 72 Follows the common Git convention for bodies

Git hook

Run commitlint from a commit-msg hook to check every commit message. This example uses Lefthook.

pnpm add --save-dev lefthook

Then add a lefthook.yaml file to your project root and run pnpm exec lefthook install.

commit-msg:
  jobs:
    - name: commitlint
      run: pnpm exec commitlint --edit {1}

About

Shared commitlint config that extends the conventional config and enforces Conventional Commits.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages