Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
format.d.ts | 2023-08-30 | 342 Bytes | |
format.d.ts.map | 2023-08-30 | 357 Bytes | |
format.js | 2023-08-30 | 3.3 kB | |
format.js.map | 2023-08-30 | 4.0 kB | |
index.d.ts | 2023-08-30 | 97 Bytes | |
index.d.ts.map | 2023-08-30 | 164 Bytes | |
index.js | 2023-08-30 | 996 Bytes | |
index.js.map | 2023-08-30 | 163 Bytes | |
Totals: 8 Items | 9.5 kB | 0 |
Format commitlint reports
@commitlint/format
Getting started
npm install --save @commitlint/format
Example
const format = require('@commitlint/format');
const output = format(
{
valid: false,
errorCount: 1,
warningCount: 1,
results: [
{
valid: false,
input: 'some: commit message',
errors: [
{
valid: false,
level: 2,
name: 'some-error',
message: 'This will show up red as it has level 2',
},
],
warnings: [
{
valid: true,
level: 0,
name: 'some-hint',
message: 'This will not show up as it has level 0',
},
{
valid: false,
level: 1,
name: 'some-warning',
message: 'This will show up yellow as it has level 1',
},
],
},
],
},
{
color: false,
}
);
process.stdout.write(output);
/* => [
'✖ 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.