All Projects → whizark → commitlint-config-cz

whizark / commitlint-config-cz

Licence: MIT license
⚙️ commitlint sharable configuration, automatically converts/merges your cz-customizable (commitizen) config.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to commitlint-config-cz

commitiquette
Plugin for Commitizen that uses commitLint configuration
Stars: ✭ 24 (+4.35%)
Mutual labels:  commitizen, conventional-commits, commitlint
fe-standard-config-seed
前端通用代码规范自动化接入
Stars: ✭ 18 (-21.74%)
Mutual labels:  commitizen, commitlint
gitmoji-commit-workflow
😉 Gitmoji Commit Workflow
Stars: ✭ 120 (+421.74%)
Mutual labels:  commitlint, commitlint-config
vite-vue3-starter
⭐ A Vite 2.x + Vue 3.x + TypeScript template starter
Stars: ✭ 384 (+1569.57%)
Mutual labels:  commitizen, commitlint
bash-for-developers
🎓 Tutorial completo e em português para devs iniciantes de como usar o Bash e o Git.
Stars: ✭ 97 (+321.74%)
Mutual labels:  commitizen, commitlint
Conventionalcommits.org
The conventional commits specification
Stars: ✭ 3,552 (+15343.48%)
Mutual labels:  conventional-changelog, conventional-commits
git
🔀 semantic-release plugin to commit release assets to the project's git repository
Stars: ✭ 235 (+921.74%)
Mutual labels:  conventional-changelog, conventional-commits
vscode-conventional-commits
💬Conventional Commits for VSCode.
Stars: ✭ 150 (+552.17%)
Mutual labels:  conventional-changelog, conventional-commits
nest-boilerplate
Nest.js boilerplate with CircleCI, Commitizen, Commitlint, Docker-Compose, ESLint, GitHub Actions, Husky, Lint-staged, OpenAPI, Prettier, PostGreSQL, Travis CI, TypeORM
Stars: ✭ 16 (-30.43%)
Mutual labels:  commitizen, commitlint
cocogitto
The Conventional Commits toolbox
Stars: ✭ 242 (+952.17%)
Mutual labels:  conventional-changelog, conventional-commits
glint
glint is a friendly tool for creating commits in the Conventional Commit style
Stars: ✭ 80 (+247.83%)
Mutual labels:  commitlint
cz-gitmoji
🔬😜 Commitizen adapter for gitmoji.
Stars: ✭ 25 (+8.7%)
Mutual labels:  commitizen
turbogit
Opinionated cli enforcing clean git workflow without comprising UX
Stars: ✭ 42 (+82.61%)
Mutual labels:  conventional-commits
git-cm
Easily create conventional-commits friendly commit messages.
Stars: ✭ 76 (+230.43%)
Mutual labels:  conventional-commits
conventional-pre-commit
A pre-commit hook that checks commit messages for Conventional Commits formatting
Stars: ✭ 66 (+186.96%)
Mutual labels:  conventional-commits
commithelper
A tool to create and lint commit messages
Stars: ✭ 35 (+52.17%)
Mutual labels:  conventional-commits
commit-semantics
Commit semantics is a git aliases installation script to follow a fix format for commits
Stars: ✭ 38 (+65.22%)
Mutual labels:  commitizen
typescript-npm-package-template
Boilerplate to kickstart creating an npm package using TypeScript
Stars: ✭ 122 (+430.43%)
Mutual labels:  commitizen
commitlint
开箱即用的代码提交规范
Stars: ✭ 51 (+121.74%)
Mutual labels:  commitlint
oyster-package-generator
Oyster is a package generator for Unity Package Manager (UPM). It generates a best standards Unity package with automated deployments via CLI. Focus on coding your package instead of deployments, changelogs, ect.
Stars: ✭ 18 (-21.74%)
Mutual labels:  commitizen

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);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].