{"id":19810041,"url":"https://github.com/whizark/commitlint-config-cz","last_synced_at":"2025-04-05T18:06:19.206Z","repository":{"id":13893784,"uuid":"75234558","full_name":"whizark/commitlint-config-cz","owner":"whizark","description":":gear: commitlint sharable configuration, automatically converts/merges your cz-customizable (commitizen) config.","archived":false,"fork":false,"pushed_at":"2025-03-07T16:04:03.000Z","size":414,"stargazers_count":36,"open_issues_count":10,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T17:07:10.888Z","etag":null,"topics":["commitizen","commitlint","commitlint-config","conventional-changelog","conventional-changelog-lint","conventional-commits","cz-cli","cz-customizable"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whizark.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-30T22:56:33.000Z","updated_at":"2024-12-04T02:15:02.000Z","dependencies_parsed_at":"2023-01-13T20:00:10.026Z","dependency_job_id":"9d67ebb1-ed24-4bc6-b4a5-f160c976d0a7","html_url":"https://github.com/whizark/commitlint-config-cz","commit_stats":{"total_commits":199,"total_committers":8,"mean_commits":24.875,"dds":0.321608040201005,"last_synced_commit":"0bd3c8137ecc063db1716f60666646fb10b77faf"},"previous_names":["whizark/conventional-changelog-lint-config-cz"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whizark%2Fcommitlint-config-cz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whizark%2Fcommitlint-config-cz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whizark%2Fcommitlint-config-cz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whizark%2Fcommitlint-config-cz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whizark","download_url":"https://codeload.github.com/whizark/commitlint-config-cz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378140,"owners_count":20929296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commitizen","commitlint","commitlint-config","conventional-changelog","conventional-changelog-lint","conventional-commits","cz-cli","cz-customizable"],"created_at":"2024-11-12T09:19:14.802Z","updated_at":"2025-04-05T18:06:19.170Z","avatar_url":"https://github.com/whizark.png","language":"JavaScript","funding_links":[],"categories":["书签"],"sub_categories":["Git"],"readme":"# commitlint-config-cz \n\n[![npm][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Build status][appveyor-image]][appveyor-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n\n[commitlint][] sharable configuration files for [cz-customizable][]\n(customizable [Commitizen][commitizen] adapter for [conventional commits][conventional-commits] and [conventional changelog][conventional-changelog]).\n\nYou can now **consistently manage your commit types/scopes** for cz-customizable and commitlint **in one place**.\n\ncommitlint-config-cz **merges** `{types,scopes,scopeOverrides}` (cz-customizable config) with\n`rules.{type-enum,scope-enum}` (commitlint config) and **includes some modules and API** for config conversion.\n\n## Supported Config\n\ncommitlint-config-cz use only one config in the following order of precedence.\n\n1. [`config.cz-customizable.config`][cz-customizable-configure] in `package.json`.\n2. `.cz-config.js` in your package root (supported by cz-customizable).\n\n## Installation\n\n1. [Install \u0026 setup (commitizen \u0026) cz-customizable.][cz-customizable]\n2. [Install commitlint.][commitlint-getting-started]\n3. Install `commitlint-config-cz` as a local dependency.\n\n   ```sh\n   npm install commitlint-config-cz --save-dev\n   ```\n\n## Usage\n\nExtend your commitlint config by `cz` in `commitlint.config.js`.\n\n```js\nmodule.exports = {\n    extends: [\n        'other-config',\n        'cz'\n    ]\n};\n```\n\n## Modules \u0026 API\n\ncommitlint-config-cz includes some modules and API for config conversion.\n\n### `config.js`\n\nGets the converted commitlint config from the cz-customizable config which is defined in `package.json` or `.cz-config.js` in your package root.\n\n```js\nconst config = require('commitlint-config-cz/lib/config')();\n````\n\n#### `get(pathOrCzConfig: string | Object, defaultConfig?: Object): Object`\n\nGets the commitlint config from a path to config file.\n\n```js\nconst getConfig = require('commitlint-config-cz/lib/config').get;\n\n// From a path.\nconst config = getConfig('path/to/.cz-config.js');\n````\n\n```js\nconst getConfig = require('commitlint-config-cz/lib/config').get;\nconst czConfig  = { /* `cz-customizable` config object. */ };\n\n// From a `cz-customizable` config object.\nconst config = getConfig(czConfig);\n````\n\n```js\nconst getConfig     = require('commitlint-config-cz/lib/config').get;\nconst czConfig      = { /* `cz-customizable` config object. */ };\nconst defaultConfig = {  // The default `commitlint` config.\n    rules: {\n        'scope-enum': [  // rule\n            2,           // [1] level\n            'always',    // [2] applicability\n            [],          // [3] value\n        ],\n        'type-enum' : [  // rule\n            2,           // [1] level\n            'always',    // [2] applicability\n            [],          // [3] value\n        ],\n    },\n};\n\n// Converts and merges the `cz-customizable` config with the default `commitlint` config.\nconst config = getConfig(czConfig, defaultConfig);\n````\n\n1. If cz-customizable config has `scopes`, `scopeOverrides` or `types` field,\n   the value(s) [3] of the default commitlint config is/are **REPLACED** by converted value(s).  \n   Level [1] and applicability [2] remain as they are.\n2. `scope-enum` rule or/and `type-enum` rule is/are **REMOVED**, if its value is an empty array.\n\n---\n\n### `cz-config.js`\n\nGets the cz-customizable config as an object from `package.json` or `.cz-config.js` in your package root.\n\n```js\nconst czConfig = require('commitlint-config-cz/lib/cz-config')();\n````\n\n#### `get(path: string): Object`\n\nGets the cz-customizable config as an object from a path.\n\n```js\nconst getCzConfig = require('commitlint-config-cz/lib/cz-config').get;\n\nconst czConfig = getCzConfig('path/to/.cz-config.js');\n````\n\n---\n\n### `scopes.js`\n\nGets the value for [scope-enum][] rule from `package.json` or `.cz-config.js` in your package root.\n\n```js\nconst scopes = require('commitlint-config-cz/lib/scopes')();\n````\n\n#### `get(czConfig: Object): string[]`\n\nGets the value for [scope-enum][] rule from a cz-customizable config object.\n\n```js\nconst getScopes = require('commitlint-config-cz/lib/scopes').get;\nconst czConfig  = { /* cz-customizable config object. */ };\n\nconst scopes = getScopes(czConfig);\n````\n\n---\n\n### `types.js`\n\nGets the value for [type-enum][] rule from `package.json` or `.cz-config.js` in your package root.\n\n```js\nconst types = require('commitlint-config-cz/lib/types')();\n````\n\n#### `get(czConfig: Object): string[]`\n\nGets the value for [type-enum][] rule from `package.json` or `cz-customizable` config object.\n\n```js\nconst getTypes = require('commitlint-config-cz/lib/types').get;\nconst czConfig = { /* `cz-customizable` config object. */ };\n\nconst types = getTypes(czConfig);\n````\n\n[commitlint]: https://github.com/conventional-changelog/commitlint\n[commitlint-getting-started]: https://github.com/conventional-changelog/commitlint#getting-started\n[cz-customizable]: https://github.com/leonardoanalista/cz-customizable\n[commitizen]: https://github.com/commitizen/cz-cli\n[conventional-commits]: https://www.conventionalcommits.org\n[conventional-changelog]: https://github.com/conventional-changelog/conventional-changelog\n[cz-customizable-configure]: https://github.com/leonardoanalista/cz-customizable#configure\n\n[npm-image]: https://img.shields.io/npm/v/commitlint-config-cz.svg\n[npm-url]: https://www.npmjs.com/commitlint-config-cz\n\n[coveralls-image]: https://coveralls.io/repos/whizark/commitlint-config-cz/badge.svg?branch=master\u0026service=github\n[coveralls-url]: https://coveralls.io/github/whizark/commitlint-config-cz?branch=master\n\n[travis-image]: https://travis-ci.org/whizark/commitlint-config-cz.svg?branch=master\n[travis-url]: https://travis-ci.org/whizark/commitlint-config-cz\n\n[appveyor-image]: https://ci.appveyor.com/api/projects/status/github/whizark/commitlint-config-cz?branch=master\u0026svg=true\n[appveyor-url]: https://ci.appveyor.com/project/whizark/commitlint-config-cz/branch/master\n\n[scope-enum]: https://commitlint.js.org/#/reference-rules?id=scope-enum\n[type-enum]: https://commitlint.js.org/#/reference-rules?id=type-enum\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhizark%2Fcommitlint-config-cz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhizark%2Fcommitlint-config-cz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhizark%2Fcommitlint-config-cz/lists"}