{"id":28931491,"url":"https://github.com/ridvanaltun/commitlint-plugin-selective-scope","last_synced_at":"2025-07-06T12:34:14.497Z","repository":{"id":57204223,"uuid":"412040876","full_name":"ridvanaltun/commitlint-plugin-selective-scope","owner":"ridvanaltun","description":"Limit scopes per type with regexp and plain text.","archived":false,"fork":false,"pushed_at":"2022-12-22T22:26:22.000Z","size":202,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-18T08:17:00.308Z","etag":null,"topics":["commitlint","commitlint-plugin","commitlintplugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ridvanaltun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-30T11:39:20.000Z","updated_at":"2025-06-08T04:36:35.000Z","dependencies_parsed_at":"2023-01-30T17:02:03.899Z","dependency_job_id":null,"html_url":"https://github.com/ridvanaltun/commitlint-plugin-selective-scope","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ridvanaltun/commitlint-plugin-selective-scope","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ridvanaltun%2Fcommitlint-plugin-selective-scope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ridvanaltun%2Fcommitlint-plugin-selective-scope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ridvanaltun%2Fcommitlint-plugin-selective-scope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ridvanaltun%2Fcommitlint-plugin-selective-scope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ridvanaltun","download_url":"https://codeload.github.com/ridvanaltun/commitlint-plugin-selective-scope/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ridvanaltun%2Fcommitlint-plugin-selective-scope/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263901113,"owners_count":23527362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commitlint","commitlint-plugin","commitlintplugin"],"created_at":"2025-06-22T16:06:23.723Z","updated_at":"2025-07-06T12:34:14.492Z","avatar_url":"https://github.com/ridvanaltun.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\n\n[![npm version](https://img.shields.io/npm/v/commitlint-plugin-selective-scope.svg)](https://npmjs.com/package/commitlint-plugin-selective-scope)\n[![npm downloads](https://img.shields.io/npm/dt/commitlint-plugin-selective-scope.svg)](https://npmjs.com/package/commitlint-plugin-selective-scope)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Build Status](https://travis-ci.com/ridvanaltun/commitlint-plugin-selective-scope.svg?branch=master)](https://travis-ci.com/ridvanaltun/commitlint-plugin-selective-scope)\n[![Coverage Status](https://coveralls.io/repos/github/ridvanaltun/commitlint-plugin-selective-scope/badge.svg?branch=master)](https://coveralls.io/github/ridvanaltun/commitlint-plugin-selective-scope?branch=master)\n[![license](https://img.shields.io/npm/l/commitlint-plugin-selective-scope.svg)](https://github.com/ridvanaltun/commitlint-plugin-selective-scope/blob/master/LICENSE)\n\n\u003e Limit scopes per type with regexp and plain text.\n\n## Installation\n\n```bash\nnpm i commitlint-plugin-selective-scope --save-dev\n```\n\n## Usage\n\n- If a type does not appear in the rule, do not enforce scope\n- If a type appears in the rule with an empty array, do not allow scope\n- If a type appears in the rule with an non-empty array, only allow the values in the array for scope.\n- If the array includes null, the scope is optional.\n\n## Example\n\n```javascript\nmodule.exports = {\n  plugins: ['selective-scope'],\n  rules: {\n    'selective-scope': [\n      2,\n      'always',\n      {\n        feat: [/^frontend\\/[^\\/]+$/, 'backend'],\n        perf: [],\n        ci: [null, 'codebuild', 'jenkins']\n      }\n    ]\n  }\n}\n```\n\n**In the above rules configuration,**\n\n- if the type is `feat`, the scope must be either match the regex `/frontend\\/[^\\/]+/` or be `backend`\n- if the type if `chore`, the scope is optional and can be anything\n- if the type is `perf`, a scope is not allowed\n- if the type is `ci`, the scope must be `codebuild` or `jenkins` if present, but is not required\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fridvanaltun%2Fcommitlint-plugin-selective-scope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fridvanaltun%2Fcommitlint-plugin-selective-scope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fridvanaltun%2Fcommitlint-plugin-selective-scope/lists"}