5
5
[ ![ Build status] [ appveyor-image ]] [ appveyor-url ]
6
6
[ ![ Coverage Status] [ coveralls-image ]] [ coveralls-url ]
7
7
8
- [ commitlint] [ ] sharable configuration files, which also includes modules & API
9
- for config conversion .
8
+ [ commitlint] [ ] sharable configuration files for [ cz-customizable ] [ ]
9
+ (customizable [ Commitizen ] [ commitizen ] adapter for [ conventional commits ] [ conventional-commits ] and [ conventional changelog ] [ conventional-changelog ] ) .
10
10
11
- If ` .cz-config.js ` that is for [ @whizark/cz-cli ] [ ] or
12
- [ cz-customizable] [ ] exists in your package root directory, its
13
- ` {types,scopes,scopeOverrides} ` are merged with
14
- ` rules.{type-enum,scope-enum} ` .
11
+ You can now ** consistently manage your commit types/scopes** for cz-customizable and commitlint ** in one place** .
12
+
13
+ commitlint-config-cz ** merges** ` {types,scopes,scopeOverrides} ` (cz-customizable config) with
14
+ ` rules.{type-enum,scope-enum} ` (commitlint config) and ** includes some modules and API** for config conversion.
15
+
16
+ ## Supported Config
17
+
18
+ commitlint-config-cz use only one config in the following order of precedence.
19
+
20
+ 1 . [ ` config.cz-customizable.config ` ] [ cz-customizable-configure ] in ` package.json ` .
21
+ 2 . ` .cz-config.js ` in your package root (supported by [ @whizark/cz-cli ] [ ] ).
15
22
16
23
## Installation
17
24
@@ -23,7 +30,7 @@ npm install commitlint-config-cz --save-dev
23
30
24
31
## Usage
25
32
26
- Extend ` commitlint- config- cz ` in ` commitlint.config.js ` .
33
+ Extend your commitlint config by ` cz ` in ` commitlint.config.js ` .
27
34
28
35
``` js
29
36
module .exports = {
@@ -36,19 +43,19 @@ module.exports = {
36
43
37
44
## Modules & API
38
45
39
- There are some modules and API to convert ` cz-customizable ` 's config into ` commitlint ` 's config .
46
+ commitlint-config-cz includes some modules and API for config conversion .
40
47
41
48
### ` config.js `
42
49
43
- Gets the ` commitlint ` config from the ` . cz-config.js` in the package root.
50
+ Gets the converted commitlint config from the cz-customizable config which is defined in ` package.json ` or ` . cz-config.js` in your package root.
44
51
45
52
``` js
46
53
const config = require (' commitlint-config-cz/lib/config' )();
47
54
````
48
55
49
56
#### ` get(pathOrCzConfig: string | Object, defaultConfig?: Object): Object`
50
57
51
- Gets the ` commitlint` config from a ` cz-customizable ` config.
58
+ Gets the commitlint config from a path to config file .
52
59
53
60
` ` ` js
54
61
const getConfig = require('commitlint-config-cz/lib/config').get;
@@ -87,24 +94,24 @@ const defaultConfig = { // The default `commitlint` config.
87
94
const config = getConfig(czConfig, defaultConfig);
88
95
` ` ` `
89
96
90
- 1. If ` cz- customizable` config has ` scopes` , ` scopeOverrides` or ` types` field,
91
- the value(s) [3] of the default ` commitlint` config is/are **REPLACED** by converted value(s).
97
+ 1. If cz-customizable config has ` scopes` , ` scopeOverrides` or ` types` field,
98
+ the value(s) [3] of the default commitlint config is/are **REPLACED** by converted value(s).
92
99
Level [1] and applicability [2] remain as they are.
93
- 2. ` scope- enum ` rule or/and ` type- enum ` rule is/are completely **REMOVED**, if its value is an empty array.
100
+ 2. ` scope- enum ` rule or/and ` type- enum ` rule is/are **REMOVED**, if its value is an empty array.
94
101
95
102
---
96
103
97
104
### ` cz- config .js `
98
105
99
- Gets the ` . cz - config . js ` as an object in the package root.
106
+ Gets the cz-customizable config as an object from ` package . json ` or ` . cz - config . js ` in your package root.
100
107
101
108
` ` ` js
102
109
const czConfig = require (' commitlint-config-cz/lib/cz-config' )();
103
110
````
104
111
105
112
#### ` get(path: string): Object`
106
113
107
- Gets the ` cz-customizable` config object from a path.
114
+ Gets the cz- customizable config as an object from a path.
108
115
109
116
` ` ` js
110
117
const getCzConfig = require('commitlint-config-cz/lib/cz-config').get;
@@ -116,19 +123,19 @@ const czConfig = getCzConfig('path/to/.cz-config.js');
116
123
117
124
### ` scopes .js `
118
125
119
- Gets the ` value` for [scope-enum][] rule from the ` .cz - config .js ` in the package root.
126
+ Gets the value for [scope-enum][] rule from ` package . json ` or ` .cz - config .js ` in your package root.
120
127
121
128
` ` ` js
122
129
const scopes = require (' commitlint-config-cz/lib/scopes' )();
123
130
````
124
131
125
132
#### ` get(czConfig: Object): string[]`
126
133
127
- Gets the ` value` for [scope- enum ][] rule from a ` cz-customizable` config object.
134
+ Gets the value for [scope- enum ][] rule from a cz- customizable config object.
128
135
129
136
` ` ` js
130
137
const getScopes = require('commitlint-config-cz/lib/scopes').get;
131
- const czConfig = { /* ` cz- customizable` config object. */ };
138
+ const czConfig = { /* cz-customizable config object. */ };
132
139
133
140
const scopes = getScopes(czConfig);
134
141
` ` ` `
@@ -137,15 +144,15 @@ const scopes = getScopes(czConfig);
137
144
138
145
### ` types .js `
139
146
140
- Gets the ` value` for [type-enum][] rule from the ` .cz - config .js ` in the package root.
147
+ Gets the value for [type-enum][] rule from ` package . json ` or ` .cz - config .js ` in your package root.
141
148
142
149
` ` ` js
143
150
const types = require (' commitlint-config-cz/lib/types' )();
144
151
````
145
152
146
153
#### ` get(czConfig: Object): string[]`
147
154
148
- Gets the ` value` for [type- enum ][] rule from a ` cz-customizable` config object.
155
+ Gets the value for [type- enum ][] rule from ` package.json ` or ` cz-customizable` config object.
149
156
150
157
` ` ` js
151
158
const getTypes = require('commitlint-config-cz/lib/types').get;
@@ -155,8 +162,12 @@ const types = getTypes(czConfig);
155
162
` ` ` `
156
163
157
164
[commitlint]: https://github.com/marionebl/commitlint
158
- [@whizark/cz-cli]: https://github.com/whizark/cz-cli
159
165
[cz-customizable]: https://github.com/leonardoanalista/cz-customizable
166
+ [commitizen]: https://github.com/commitizen/cz-cli
167
+ [conventional-commits]: https://www.conventionalcommits.org
168
+ [conventional-changelog]: https://github.com/conventional-changelog/conventional-changelog
169
+ [cz-customizable-configure]: https://github.com/leonardoanalista/cz-customizable#configure
170
+ [@whizark/cz-cli]: https://github.com/whizark/cz-cli
160
171
161
172
[npm-image]: https://img.shields.io/npm/v/commitlint-config-cz.svg
162
173
[npm-url]: https://www.npmjs.com/commitlint-config-cz
0 commit comments