New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

danger-plugin-conventional-commitlint

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

danger-plugin-conventional-commitlint

lint commit messages with danger and commitlint

latest
Source
npmnpm
Version
3.1.0
Version published
Weekly downloads
1.1K
-16.12%
Maintainers
1
Weekly downloads
 
Created
Source

danger-plugin-conventional-commitlint

CI npm version semantic-release code style: prettier

A danger plugin to lint commit messages with commitlint

Usage

Install:

npm install --save-dev danger-plugin-conventional-commitlint

At a glance:

// dangerfile.js
import commitlint from 'danger-plugin-conventional-commitlint';
import configConventional from '@commitlint/config-conventional';

(async function dangerReport() {
  const commitlintConfig = {
    severity: 'warn',
  };
  await commitlint(configConventional.rules, commitlintConfig);
})();

Note: you must provide your own rules to the function

API

commitlint([rules], [options])

Options

severity

Type: String
Choices: 'fail' | 'warn' | 'message'
Default: 'fail'
Danger method to call when the commit message does not pass the linter

messageReplacer

Type:

(ruleOutcome: LintOutcome, commitMessage: string) => string;

Default:

There is a problem with the commit message > [Commit message] - [Error Messages]

Method to add a custom message. When not passed, a default message is shown. Example:

const messageReplacer = (
  ruleOutcome: LintOutcome,
  commitMessage: string,
): string => {
  const errorsDescription = ruleOutcome.errors
    .map((error) => `<li>${error.message}</li>`)
    .join('');

  return `<p>Commit message: <b>"${commitMessage}"</b></p><ul>${errorsDescription}</ul> Suffix after commit message`;
};

Changelog

See the GitHub release history.

Contributing

See CONTRIBUTING.md.

Keywords

danger

FAQs

Package last updated on 30 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts