conventional-changelog-action/node_modules/@commitlint/lint
Conventional Changelog Action 1af857c6a9 chore(release): v3.9.5 2021-10-05 21:52:13 +00:00
..
CHANGELOG.md chore(release): v3.9.5 2021-10-05 21:52:13 +00:00
README.md chore(release): v3.9.5 2021-10-05 21:52:13 +00:00
license.md chore(release): v3.9.5 2021-10-05 21:52:13 +00:00
package.json chore(release): v3.9.5 2021-10-05 21:52:13 +00:00

README.md

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.