Skip to content

Commit

Permalink
docs(format): update api to match function arguments (conventional-ch…
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric authored Feb 13, 2019
1 parent d0507bd commit 9e2cf60
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions docs/reference-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ type Problem = {
}

type Report = {
results: ReportResult[];
}

type ReportResult = {
errors: Problem[];
warnings: Problem[];
}
Expand All @@ -53,23 +57,27 @@ const format = require('@commitlint/format');
format(); // => [ '\u001b[1m\u001b[32m✔\u001b[39m found 0 problems, 0 warnings\u001b[22m' ]

format({
warnings: [
{
level: 0,
name: 'some-hint',
message: 'This will not show up as it has level 0'
},
{
level: 1,
name: 'some-warning',
message: 'This will show up yellow as it has level 1'
}
],
errors: [
results: [
{
level: 2,
name: 'some-error',
message: 'This will show up red as it has level 2'
warnings: [
{
level: 0,
name: 'some-hint',
message: 'This will not show up as it has level 0'
},
{
level: 1,
name: 'some-warning',
message: 'This will show up yellow as it has level 1'
}
],
errors: [
{
level: 2,
name: 'some-error',
message: 'This will show up red as it has level 2'
}
]
}
]
}, {
Expand Down

0 comments on commit 9e2cf60

Please sign in to comment.