1 | # @commitlint/config-angular-type-enum
|
2 |
|
3 | Shareable `commitlint` config enforcing the angular commit convention types.
|
4 | Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli).
|
5 |
|
6 | See [@commitlint/config-angular](../config-angular) for full angular conventions.
|
7 |
|
8 | ## Getting started
|
9 |
|
10 | ```sh
|
11 | npm install --save-dev @commitlint/config-angular-types @commitlint/cli
|
12 | echo "module.exports = {extends: ['@commitlint/config-angular-type-enum']};" > commitlint.config.js
|
13 | ```
|
14 |
|
15 | ## Usage
|
16 |
|
17 | ```sh
|
18 | echo "foo: bar" | commitlint # fails
|
19 | echo "build: bar" | commitlint # passes
|
20 | ```
|
21 |
|
22 | ## Examples
|
23 |
|
24 | ```js
|
25 | // commitlint.config.js
|
26 | const types = require("@commitlint/config-angular-type-enum");
|
27 |
|
28 | // Use as rule creating errors for non-allowed types
|
29 | module.exports = {
|
30 | rules: {
|
31 | ...types.rules
|
32 | }
|
33 | };
|
34 |
|
35 | // Warn for non-allowed types
|
36 | module.exports = {
|
37 | rules: {
|
38 | 'type-enum': [1, 'always', types.values()]
|
39 | }
|
40 | };
|
41 | ```
|