@commitlint/config-lerna-scopes
Version:
Shareable commitlint config enforcing lerna package and workspace names as scopes
45 lines (31 loc) • 1.24 kB
Markdown
# /config-lerna-scopes
Lint your lerna project commits
Shareable `commitlint` config enforcing lerna package scopes.
Use with [/cli](../cli) and [/prompt-cli](../prompt-cli).
> [!IMPORTANT]
> If you are using NPM or Yarn workspaces, please use the [/config-workspace-scopes](../config-workspace-scopes/) package instead. Support for workspaces will be removed from this package in a future major version.
## Getting started
```sh
npm install --save-dev /config-lerna-scopes @commitlint/cli
echo "export default {extends: ['@commitlint/config-lerna-scopes']};" > commitlint.config.js
```
## Examples
```text
❯ cat commitlint.config.js
{
extends: ['/config-lerna-scopes']
}
❯ tree packages
packages
├── api
├── app
└── web
❯ echo "build(api): change something in api's build" | commitlint
❯ echo "test(foo): this won't pass" | commitlint
⧗ --- input ---
test(foo): this won't pass
✖ scope must be one of [api, app, web] [scope-enum]
✖ found 1 problems, 0 warnings
❯ echo "ci: do some general maintenance" | commitlint
```
Consult [Rules reference](https://commitlint.js.org/reference/rules) for a list of available rules.