@commitlint/lint
    TypeScript icon, indicating that this package has built-in type declarations

    13.1.0 • Public • Published

    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.

    Install

    npm i @commitlint/lint

    DownloadsWeekly Downloads

    1,165,833

    Version

    13.1.0

    License

    MIT

    Unpacked Size

    23.4 kB

    Total Files

    12

    Last publish

    Collaborators

    • marionebl
    • martinhelmut
    • escapedcat
    • bycedric