Detalhes do pacote

commitlint-plugin-workspace-scopes

material-svelte7.1kMIT1.1.0

A commitlint rule to discover workspace packages as scopes.

commitlint, commitlintplugin, pnpm, yarn

readme (leia-me)

commitlint-plugin-workspace-scopes

A commitlint plugin to discover workspace packages as scopes.

Installation

pnpm

pnpm install --dev commitlint-plugin-workspace-scopes

yarn

yarn add --dev commitlint-plugin-workspace-scopes

npm

npm install --save-dev commitlint-plugin-workspace-scopes

Usage

To configure that only workspace-packages are accepted scopes:

module.exports = {
  plugins: ['workspace-scopes'],
  rules: {
    'scope-enum': [2, 'always', []],
  },
};

To configure that workspace-packages and codeowners are accepted scopes:

module.exports = {
  plugins: ['workspace-scopes'],
  rules: {
    'scope-enum': [2, 'always', ['codeowners']],
  },
};

Examples

$ cat commitlint.config.js

module.exports = {
  extends: ['@commitlint/config-conventional'],
  plugins: ['workspace-scopes'],
  rules: {
    'scope-enum': [2, 'always', ['codeowners']]
  }
}

$ tree packages

packages
├── api
├── app
└── web

$ echo "feat(api): this will succeed" | npx commitlint --verbose
⧗   input: feat(api): this will succeed
✔   found 0 problems, 0 warnings

$ echo "feat(codeowners): this will succeed" | npx commitlint --verbose
⧗   input: feat(codeowners): this will succeed
✔   found 0 problems, 0 warnings

$ echo "feat(foo): this will fail" | npx commitlint --verbose
⧗   input: feat(foo): this will fail
✖   scope must be one of [api, app, web] [scope-enum]
✖   found 1 problems, 0 warnings

changelog (log de mudanças)

commitlint-plugin-workspace-scopes 1.1.0 (2021-03-11)

Features

  • commitlint-plugin-workspace-scopes: bump version to fix npm-publish (ed09b4b)