commitlint-plugin-scope-empty-exceptions

    1.1.0 • Public • Published

    commitlint-plugin-scope-empty-exceptions

    A commitlint plugin to support exceptions in scope-empty-rules.

    Installation

    pnpm

    pnpm install --dev commitlint-plugin-scope-empty-exceptions

    yarn

    yarn add --dev commitlint-plugin-scope-empty-exceptions

    npm

    npm install --save-dev commitlint-plugin-scope-empty-exceptions

    Usage

    To configure that scopes for types ci and chore can be empty, while other scopes can not:

    module.exports = {
      plugins: ['scope-empty-exceptions'],
      rules: {
        'scope-empty': [2, 'never', ['ci', 'chore']],
      },
    };

    Examples

    $ cat commitlint.config.js
    
    module.exports = {
      extends: ['@commitlint/config-conventional'],
      plugins: ['scope-empty-exceptions'],
      rules: {
        'scope-empty': [2, 'always', ['ci']]
      }
    }
    
    $ echo "ci: this will succeed" | npx commitlint --verbose
    ⧗   input: ci: this will succeed
    ✔   found 0 problems, 0 warnings
    
    $ echo "feat: this will fail" | npx commitlint --verbose
    ⧗   input: feat: this will fail
    ✖   scope may not be empty [scope-empty]
    ✖   found 1 problems, 0 warnings
    

    Install

    npm i commitlint-plugin-scope-empty-exceptions

    DownloadsWeekly Downloads

    214

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    2.87 kB

    Total Files

    4

    Last publish

    Collaborators

    • material-svelte-bot