UNPKG

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