开发者社区> 镜像站> NPM> @commitlint/format
@commitlint/format
Format commitlint reports
Last updated 3 months ago by escapedcat .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @commitlint/format 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 11.0.0                                ...           latest (3 months ago)

27 Versions

  • 11.0.0                                ...           3 months ago
  • 10.0.0                                ...           4 months ago
  • 9.1.2                                ...           5 months ago
  • 9.1.1                                ...           5 months ago
  • 9.1.0                                ...           5 months ago
  • 9.0.1                                ...           6 months ago
  • 9.0.0                                ...           6 months ago
  • 8.3.4                                ...           a year ago
  • 8.3.2                                ...           a year ago
  • 8.3.0                                ...           a year ago
  • 8.2.0                                ...           a year ago
  • 8.1.0                                ...           a year ago
  • 8.0.0                                ...           2 years ago
  • 7.6.1                                ...           2 years ago
  • 7.6.0                                ...           2 years ago
  • 7.5.0                                ...           2 years ago
  • 7.4.0                                ...           2 years ago
  • 7.3.1                                ...           2 years ago
  • 7.3.0                                ...           2 years ago
  • 7.2.1                                ...           2 years ago
  • 7.2.0                                ...           2 years ago
  • 7.1.2                                ...           2 years ago
  • 7.1.1                                ...           2 years ago
  • 7.0.0                                ...           3 years ago
  • 6.1.3                                ...           3 years ago
  • 6.1.2                                ...           3 years ago
  • 6.1.1                                ...           3 years ago