Skip to content

BondarenkoAlex/semantic-release-commits-lint

Repository files navigation

semantic-release-commits-lint

semantic-release plugin for analyzing commit messages by commitlint

Test Release Coverage Coverage Coverage Coverage

Step Description
analyzeCommits Analyzing commit messages by commitlint.

process-work

Profit

Does not semantic-release set dist-tag? Perhaps, you write commit-message not right. This plugin lets to find so error.

Install

npm install semantic-release-commits-lint -D

Usage

The plugin can be configured in the semantic-release configuration file:

{
  "plugins": [
    "semantic-release-commits-lint"
  ]
}

Configuration

Options

Options Description Default
commitlintFile File path of the commitlint config. -
commitlintConfig Commitlint config as object. -

Notes: For the plugin to work correctly, you need to configure commitlint config

Example configuration

Configuration globaly in project

  1. Install @commitlint/config-conventional if need.
npm install @commitlint/config-conventional -D
  1. Add commitlint config file in project

.commitlintrc.json

{
  "extends": ["@commitlint/config-conventional"],
  "rules": {
    "type-case": [2, "always", ["pascal-case"]]
  }
}
  1. Configuration semantic-release

.releaserc

{
  "plugins": [
    "semantic-release-commits-lint"
  ]
}

Configuration by commitlintFile option

  1. Install @commitlint/config-conventional if need.
npm install @commitlint/config-conventional -D
  1. Add commitlint config file in project

.commitlintrc-for-semantic-release.json

{
  "extends": ["@commitlint/config-conventional"],
  "rules": {
    "type-case": [2, "always", ["pascal-case"]]
  }
}
  1. Configuration semantic-release

.releaserc

{
  "plugins": [
    [
      "semantic-release-commits-lint",
      {
        "commitlintFile": ".commitlintrc-for-semantic-release.json"
      }
    ]
  ]
}

Configuration by commitlintConfig option

  1. Install @commitlint/config-conventional if need.
npm install @commitlint/config-conventional -D
  1. Configuration semantic-release

.releaserc

{
  "plugins": [
    [
      "semantic-release-commits-lint",
      {
        "commitlintConfig": {
          "extends": ["@commitlint/config-conventional"],
          "rules": {
            "type-case": [2, "always", ["pascal-case"]]
          }
        }
      }
    ]
  ]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published