@commitlint/lint

Lint a string against commitlint rules

Stats

StarsIssuesVersionUpdatedCreatedSize
@commitlint/lint
8,71210413.2.020 days ago4 years agoMinified + gzip package size for @commitlint/lint in KB

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.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.