Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

commitlint-config-cz

whizark11.9kMIT0.13.3

commitlint sharable configuration files

git, commit, commitlint, commitlint-config, conventional-changelog, conventional-changelog-lint-config, lint

readme

commitlint-config-cz

npm Build Status Build status Coverage Status

commitlint sharable configuration files for cz-customizable (customizable Commitizen adapter for conventional commits and conventional changelog).

You can now consistently manage your commit types/scopes for cz-customizable and commitlint in one place.

commitlint-config-cz merges {types,scopes,scopeOverrides} (cz-customizable config) with rules.{type-enum,scope-enum} (commitlint config) and includes some modules and API for config conversion.

Supported Config

commitlint-config-cz use only one config in the following order of precedence.

  1. config.cz-customizable.config in package.json.
  2. .cz-config.js in your package root (supported by cz-customizable).

Installation

  1. Install & setup (commitizen &) cz-customizable.
  2. Install commitlint.
  3. Install commitlint-config-cz as a local dependency.

    npm install commitlint-config-cz --save-dev

Usage

Extend your commitlint config by cz in commitlint.config.js.

module.exports = {
    extends: [
        'other-config',
        'cz'
    ]
};

Modules & API

commitlint-config-cz includes some modules and API for config conversion.

config.js

Gets the converted commitlint config from the cz-customizable config which is defined in package.json or .cz-config.js in your package root.

const config = require('commitlint-config-cz/lib/config')();
`

get(pathOrCzConfig: string | Object, defaultConfig?: Object): Object

Gets the commitlint config from a path to config file.

const getConfig = require('commitlint-config-cz/lib/config').get;

// From a path.
const config = getConfig('path/to/.cz-config.js');
`
const getConfig = require('commitlint-config-cz/lib/config').get;
const czConfig  = { /* `cz-customizable` config object. */ };

// From a `cz-customizable` config object.
const config = getConfig(czConfig);
`
const getConfig     = require('commitlint-config-cz/lib/config').get;
const czConfig      = { /* `cz-customizable` config object. */ };
const defaultConfig = {  // The default `commitlint` config.
    rules: {
        'scope-enum': [  // rule
            2,           // [1] level
            'always',    // [2] applicability
            [],          // [3] value
        ],
        'type-enum' : [  // rule
            2,           // [1] level
            'always',    // [2] applicability
            [],          // [3] value
        ],
    },
};

// Converts and merges the `cz-customizable` config with the default `commitlint` config.
const config = getConfig(czConfig, defaultConfig);
`
  1. If cz-customizable config has scopes, scopeOverrides or types field, the value(s) [3] of the default commitlint config is/are REPLACED by converted value(s).
    Level [1] and applicability [2] remain as they are.
  2. scope-enum rule or/and type-enum rule is/are REMOVED, if its value is an empty array.

cz-config.js

Gets the cz-customizable config as an object from package.json or .cz-config.js in your package root.

const czConfig = require('commitlint-config-cz/lib/cz-config')();
`

get(path: string): Object

Gets the cz-customizable config as an object from a path.

const getCzConfig = require('commitlint-config-cz/lib/cz-config').get;

const czConfig = getCzConfig('path/to/.cz-config.js');
`

scopes.js

Gets the value for scope-enum rule from package.json or .cz-config.js in your package root.

const scopes = require('commitlint-config-cz/lib/scopes')();
`

get(czConfig: Object): string[]

Gets the value for scope-enum rule from a cz-customizable config object.

const getScopes = require('commitlint-config-cz/lib/scopes').get;
const czConfig  = { /* cz-customizable config object. */ };

const scopes = getScopes(czConfig);
`

types.js

Gets the value for type-enum rule from package.json or .cz-config.js in your package root.

const types = require('commitlint-config-cz/lib/types')();
`

get(czConfig: Object): string[]

Gets the value for type-enum rule from package.json or cz-customizable config object.

const getTypes = require('commitlint-config-cz/lib/types').get;
const czConfig = { /* `cz-customizable` config object. */ };

const types = getTypes(czConfig);
`

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

0.13.3 (2021-12-20)

Build System

  • [security] bump hosted-git-info from 2.7.1 to 2.8.9 (c526430)
  • [security] bump ini from 1.3.5 to 1.3.8 (e753839)
  • [security] bump y18n from 4.0.0 to 4.0.3 (81d216e)
  • fix low severity vulnerabilities (63320b8)
  • fix vulnerable dependencies (fd61a18)
  • remove peerDependencies (d697c58), closes #70
  • update dependencies (164bd1a)
  • update dependency @commitlint/cli to v13 (05d8320)
  • update dependency @commitlint/cli to v9 (72df7e9)
  • update dependency coveralls to v3.1.0 (ea93232)
  • update dependency mocha to v7.1.2 (ddea362)
  • update dependency mocha to v7.2.0 (4e7c113)
  • update dependency mocha to v8 (716d5a1)
  • update dependency mocha to v8.1.1 (2d84aca)
  • update dependency mocha to v8.1.2 (92f46b1)
  • update dependency mocha to v8.1.3 (07dcc94)
  • update dependency mocha to v8.2.1 (8b7f890)
  • update dependency mocha to v8.4.0 (b92c1a3)
  • update dependency nyc to v15.0.1 (2770243)
  • update dependency nyc to v15.1.0 (7fe075c)
  • update dependency standard-version to v8 (51b1378)
  • update dependency standard-version to v8.0.1 [security] (99ab240)
  • update dependency standard-version to v9 (10535f4)
  • update dependency standard-version to v9.3.2 (c67fa48)

0.13.2 (2020-08-20)

Build System

  • fix low severity vulnerabilities (63320b8)
  • update dependency @commitlint/cli to v9 (72df7e9)
  • update dependency coveralls to v3.1.0 (ea93232)
  • update dependency mocha to v7.1.2 (ddea362)
  • update dependency mocha to v7.2.0 (4e7c113)
  • update dependency mocha to v8 (716d5a1)
  • update dependency mocha to v8.1.1 (2d84aca)
  • update dependency nyc to v15.0.1 (2770243)
  • update dependency nyc to v15.1.0 (7fe075c)
  • update dependency standard-version to v8 (51b1378)
  • update dependency standard-version to v8.0.1 [security] (99ab240)
  • update dependency standard-version to v9 (10535f4)

0.13.1 (2020-03-19)

Build System

  • [security] bump acorn from 5.7.3 to 5.7.4 (8e664fa)
  • add standard-version config (741d3b4)
  • update dependency coveralls to v3.0.11 (fefe423)
  • update dependency mocha to v7.1.0 (519f65a)
  • update dependency mocha to v7.1.1 (8e895d5)
  • update minimist to 1.2.5 to fix low severity vulnerabilities (74a4066)

0.13.0 (2020-02-03)

⚠ BREAKING CHANGES

  • Node.js 8 support has been dropped due to EOL.

Bug Fixes

  • update dependency app-root-path to v3 (be58d72)

ci

0.12.1 (2019-08-04)

0.12.0 (2019-06-16)

Bug Fixes

  • deps: update dependency app-root-path to ~2.2.0 (8f06c50)

ci

  • drop Node 6 support, add Node 12 (04c106d)

BREAKING CHANGES

  • Node 6 support has been dropped due to EOL.

0.11.1 (2019-01-10)

Bug Fixes

0.11.0 (2018-12-24)

Features

  • support config.cz-customizable.config entry in package.json (753036d) (zman)

0.10.1 (2018-08-23)

Bug Fixes

  • error is thrown if there's no scope-{enum,type} rule at all (1dc784e), closes #3

0.10.0 (2018-06-22)

  • bump version to 0.10.0 (13c0ea7)
  • update @commitlint/cli to 7.0.0 (673019c)
  • update dev dependencies (f0af131)

0.9.0 (2018-05-25)

  • add Node 10 for Travis CI (017c594)
  • bump version to 0.9.0 (b44d6bf)
  • drop Node 4, 7 support (942a85b)
  • remove Node 4/7, add 9/10 for Appveyor (c0ba1af)
  • support @commitlint/cli 6.2.0 (5800d7b)
  • update dev dependencies (c072db5)
  • use npm update with --no-save on Travis CI (c2b1dfd), closes #1

0.8.0 (2018-02-23)

0.7.0 (2017-11-05)

  • add description about config conversion feature (58c0827)
  • add docs for Modules & API (c3ef3f4)
  • add JSDoc to API functions (4ea7d9f)
  • add new module & API for config conversion (1b387f2), closes #2
  • add summary to Module & API section (94bfeff)
  • bump version to 0.7.0 (c37afef)
  • fix config.js description (6b78802)
  • make language of fenced code block consistent (2cb6e3c)
  • refactor variable name to clarify config for cz-customizable (887ab40)
  • refactor variable names in test (2b0f25a)
  • remove default rules except for type-enum, scope-enum (749122c)
  • remove NLP-related rules (9feaf18)

BREAKING CHANGE

  • Now commitlint-config-cz provides only type-enum, scope-enum rules by the default. In case that you need other rules, you may override other config with commitlint-config-cz rules.
module.exports = {
    extends: [
        'other-config',
        'cz'
    ]
};

0.6.0 (2017-11-04)

  • bump version to 0.6.0 (24ab6fb)
  • change case options to kebab-case (e9cfdeb)
  • update commitlint to 4.2.2 (e8e7f01)
  • update dev dependencies (770f553)

0.5.0 (2017-08-10)

  • add new signed-off-by rule (3740ff0)
  • bump version to 0.5.0 (29aaf59)
  • fix incorrect config example in README.md (cc0a092)
  • update @commitlint/cli to 3.1.2 (7f1c5ef)
  • update dev dependencies (dc2bede)

0.4.0 (2017-07-20)

  • add commitlint-config to keywords in package.json (c5bd3bc)
  • add Node.js 8 for Travis CI, AppVeyor (be33db7)
  • bump version to 0.4.0 (1a7e708)
  • fix incorrect config file name in README.md (8f54a8e)
  • remove npm prune from CI build (461199d), closes #17797
  • remove wildcards entry (4f5fc4b)
  • replace conventional-changelog-lint to commitlint (a078090)
  • update conventional-changelog-lint as peerDependencies (8babbee)
  • update dev dependencies (c5b6834)
  • update notification setting for Slack (0d0d6ae)
  • update npm API key (a6f2d20)
  • use npm install until npm update issue is resolved (5f309db)

0.3.0 (2017-04-04)

  • bump version to 0.3.0 (201fa10)
  • turn the severities of {body,footer}-tense rules into warning (c56dd22)
  • update dependencies (a6e1bc6)

0.2.0 (2016-12-10)

  • add AppVeyor badge to README.md (e21720c)
  • add AppVeyor config (b204b3d)
  • bump version to 0.2.0 (07be0a1)
  • disable shallow clone for AppVeyor (b1be017)
  • explicitly update npm to the latest version in .travis.yml (f381be7)
  • make the default value for type-enum rule empty (7f2c386)
  • use --save-dev rather than --save for installation (db18896)

0.1.1 (2016-12-02)

  • add coveralls badge to README.md (f5e8f42)
  • add tests (643475d)
  • bump version to 0.1.1 (3d75584)
  • export cz-config.js loader function (978990a)
  • export default types, scopes (bfd5946)
  • fix issue that .cz-config.js isn't load (aa38aa7)
  • fix issue that scopeOverrides is never merged (d0b2aee)
  • fix issue that scopes is always empty (8fbd0dd)
  • fix repo name in .travis.yml for deploy (afba42d)
  • silently run npm scripts (1010a33)

0.1.0 (2016-12-01)

  • add .travis.yml for Travis CI (1211226)
  • add perf as a default type (895787b)
  • add config files (18645c4)
  • add initial package files (dba6dfe)
  • add introduction to README.md (9a31514)
  • bump version to 0.1.0 (5d3fd7a)
  • fix broken installation test (403c261)
  • fix incorrect copyright year (43d7d48)
  • fix incorrect usage explanation (dabab61)
  • improve wildcards messages for merge and pull request (edd9eb2)
  • prepare repository (4a8b8ab)
  • remove release from wildcards (d5b2204)
  • rename repo/package name to conventional-changelog-lint-config-cz (50883d3)
  • use latest conventional-changelog-lint as devDependencies (18ea8fb)
  • use reference for link to conventional-changelog-lint (cc9341a)