File tree 1 file changed +34
-18
lines changed
1 file changed +34
-18
lines changed Original file line number Diff line number Diff line change @@ -13,29 +13,44 @@ npm install --save @commitlint/format
13
13
``` js
14
14
const format = require (' @commitlint/format' );
15
15
16
- format ({
17
- warnings: [
16
+ const output = format ({
17
+ valid: false ,
18
+ errorCount: 1 ,
19
+ warningCount: 1 ,
20
+ results: [
18
21
{
19
- level: 0 ,
20
- name: ' some-hint' ,
21
- message: ' This will not show up as it has level 0'
22
- },
23
- {
24
- level: 1 ,
25
- name: ' some-warning' ,
26
- message: ' This will show up yellow as it has level 1'
27
- }
28
- ],
29
- errors: [
30
- {
31
- level: 2 ,
32
- name: ' some-error' ,
33
- message: ' This will show up red as it has level 2'
22
+ valid: false ,
23
+ input: ' some: commit message' ,
24
+ errors: [
25
+ {
26
+ valid: false ,
27
+ level: 2 ,
28
+ name: ' some-error' ,
29
+ message: ' This will show up red as it has level 2'
30
+ }
31
+ ],
32
+ warnings: [
33
+ {
34
+ valid: true ,
35
+ level: 0 ,
36
+ name: ' some-hint' ,
37
+ message: ' This will not show up as it has level 0'
38
+ },
39
+ {
40
+ valid: false ,
41
+ level: 1 ,
42
+ name: ' some-warning' ,
43
+ message: ' This will show up yellow as it has level 1'
44
+ }
45
+ ]
34
46
}
35
- ]
47
+ ]
36
48
}, {
37
49
color: false
38
50
});
51
+
52
+ process .stdout .write (output);
53
+
39
54
/* => [
40
55
'✖ This will show up red as it has level 2 [some-error]',
41
56
' This will not show up as it has level 0 [some-hint]',
@@ -45,3 +60,4 @@ format({
45
60
```
46
61
47
62
Consult [ docs/api] ( http://marionebl.github.io/commitlint/#/reference-api ) for comprehensive documentation.
63
+
You can’t perform that action at this time.
0 commit comments