commitlint-config-pnpm-workspace
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

commitlint-config-pnpm-workspace

Shareable commitlint config enforcing scopes from pnpm workspace packages

Installation

pnpm add -D commitlint-config-pnpm-workspace

Usage

Add the following snippet in the commitlint config file of your project:

{
  "extends": ["pnpm-workspace"]
}

Since commitlint's scope-enum rule does not support / in the scope names, scope names with @scope/ prefix will be stripped.

To add custom scopes, use getPackages functions:

const { getPackages } = require('commitlint-config-pnpm-workspace')

modules.exports = {
  ...,
  'scope-empty': [2, 'never'],
  'scope-enum': async (context) => [
    2,
    'always',
    [
      ...(await getPackages(context)),
      'root',
    ],
  ],
}

Usage with commitlint-plugin-scope-enhanced

To use the scope-enum-enhanced rule from commitlint-plugin-scope-enhanced instead of the default scope-enum rule, extend from pnpm-workspace/scope-enhanced instead:

{
  "extends": ["pnpm-workspace/scope-enhanced"],
  "plugins": ["scope-enhanced"]
}

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i commitlint-config-pnpm-workspace

Weekly Downloads

67

Version

0.2.2

License

MIT

Unpacked Size

11.1 kB

Total Files

11

Last publish

Collaborators

  • nex