Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

commitlint-plugin-selective-scope

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commitlint-plugin-selective-scope

Limit scopes per type with regexp and plain text

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Introduction

npm version npm downloads Commitizen friendly semantic-release Build Status Coverage Status license

Limit scopes per type with regexp and plain text.

Installation

npm i commitlint-plugin-selective-scope --save-dev

Usage

  • If a type does not appear in the rule, do not enforce scope
  • If a type appears in the rule with an empty array, do not allow scope
  • If a type appears in the rule with an non-empty array, only allow the values in the array for scope.
  • If the array includes null, the scope is optional.

Example

module.exports = {
  plugins: ['selective-scope'],
  rules: {
    'selective-scope': [
      2,
      'always',
      {
        feat: [/^frontend\/[^\/]+$/, 'backend'],
        perf: [],
        ci: [null, 'codebuild', 'jenkins']
      }
    ]
  }
}

In the above rules configuration,

  • if the type is feat, the scope must be either match the regex /frontend\/[^\/]+/ or be backend
  • if the type if chore, the scope is optional and can be anything
  • if the type is perf, a scope is not allowed
  • if the type is ci, the scope must be codebuild or jenkins if present, but is not required

Keywords

FAQs

Package last updated on 22 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc