From 9e2cf60504e58a094acae190814d9fedd25eef0f Mon Sep 17 00:00:00 2001 From: Cedric van Putten Date: Thu, 14 Feb 2019 00:16:47 +0100 Subject: [PATCH] docs(format): update api to match function arguments (#581) --- docs/reference-api.md | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/docs/reference-api.md b/docs/reference-api.md index 63f4b6bb63..3cc1066060 100644 --- a/docs/reference-api.md +++ b/docs/reference-api.md @@ -31,6 +31,10 @@ type Problem = { } type Report = { + results: ReportResult[]; +} + +type ReportResult = { errors: Problem[]; warnings: Problem[]; } @@ -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' + } + ] } ] }, {