JSPM

  • Created
  • Published
  • Downloads 4634236
  • Score
    100M100P100Q203210F
  • License MIT

Lint a string against commitlint rules

Package Exports

  • @commitlint/lint
  • @commitlint/lint/lib/commit-message
  • @commitlint/lint/lib/commit-message.js
  • @commitlint/lint/lib/lint.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@commitlint/lint) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Lint a string against commitlint rules

@commitlint/lint

Getting started

npm install --save @commitlint/lint

Example

const lint = require('@commitlint/lint').default;

lint('foo: bar', {'type-enum': [1, 'always', ['foo']]}).then((report) =>
  console.log(report)
);
// => { valid: true, errors: [], warnings: [] }

lint('foo: bar', {'type-enum': [1, 'always', ['bar']]}).then((report) =>
  console.log(report)
);
/* =>
    { valid: true,
      errors: [],
      warnings:
      [ { level: 1,
          valid: false,
          name: 'type-enum',
          message: 'type must be one of [bar]' } ] }
  */

Consult docs/api for comprehensive documentation.