Format commitlint reports
npm install --save @commitlint/format
const format = require('@commitlint/format');
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: [
{
level: 2,
name: 'some-error',
message: 'This will show up red as it has level 2'
}
]
}, {
color: false
});
/* => [
'β This will show up red as it has level 2 [some-error]',
' This will not show up as it has level 0 [some-hint]',
'β This will show up yellow as it has level 1 [some-warning]',
'β found 1 problems, 2 warnings'
] */
Consult docs/api for comprehensive documentation.