Skip to content

Commit 9e2cf60

Browse files
authored
docs(format): update api to match function arguments (conventional-changelog#581)
1 parent d0507bd commit 9e2cf60

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

docs/reference-api.md

+24-16
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ type Problem = {
3131
}
3232

3333
type Report = {
34+
results: ReportResult[];
35+
}
36+
37+
type ReportResult = {
3438
errors: Problem[];
3539
warnings: Problem[];
3640
}
@@ -53,23 +57,27 @@ const format = require('@commitlint/format');
5357
format(); // => [ '\u001b[1m\u001b[32m✔\u001b[39m found 0 problems, 0 warnings\u001b[22m' ]
5458

5559
format({
56-
warnings: [
57-
{
58-
level: 0,
59-
name: 'some-hint',
60-
message: 'This will not show up as it has level 0'
61-
},
62-
{
63-
level: 1,
64-
name: 'some-warning',
65-
message: 'This will show up yellow as it has level 1'
66-
}
67-
],
68-
errors: [
60+
results: [
6961
{
70-
level: 2,
71-
name: 'some-error',
72-
message: 'This will show up red as it has level 2'
62+
warnings: [
63+
{
64+
level: 0,
65+
name: 'some-hint',
66+
message: 'This will not show up as it has level 0'
67+
},
68+
{
69+
level: 1,
70+
name: 'some-warning',
71+
message: 'This will show up yellow as it has level 1'
72+
}
73+
],
74+
errors: [
75+
{
76+
level: 2,
77+
name: 'some-error',
78+
message: 'This will show up red as it has level 2'
79+
}
80+
]
7381
}
7482
]
7583
}, {

0 commit comments

Comments
 (0)