1 | > Lint your lerna project commits
|
2 |
|
3 | # @commitlint/config-lerna-scopes
|
4 |
|
5 | Shareable `commitlint` config enforcing lerna package and workspace names as scopes.
|
6 | Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli).
|
7 |
|
8 | ## Getting started
|
9 |
|
10 | ```
|
11 | npm install --save-dev @commitlint/config-lerna-scopes @commitlint/cli
|
12 | echo "module.exports = {extends: ['@commitlint/config-lerna-scopes']};" > commitlint.config.js
|
13 | ```
|
14 |
|
15 | ## Examples
|
16 |
|
17 | ```
|
18 | ❯ cat commitlint.config.js
|
19 | {
|
20 | extends: ['@commitlint/config-lerna-scopes']
|
21 | }
|
22 |
|
23 | ❯ tree packages
|
24 |
|
25 | packages
|
26 | ├── api
|
27 | ├── app
|
28 | └── web
|
29 |
|
30 | ❯ echo "build(api): change something in api's build" | commitlint
|
31 | ⧗ input: build(api): change something in api's build
|
32 | ✔ found 0 problems, 0 warnings
|
33 |
|
34 | ❯ echo "test(foo): this won't pass" | commitlint
|
35 | ⧗ input: test(foo): this won't pass
|
36 | ✖ scope must be one of [api, app, web] [scope-enum]
|
37 | ✖ found 1 problems, 0 warnings
|
38 |
|
39 | ❯ echo "ci: do some general maintenance" | commitlint
|
40 | ⧗ input: ci: do some general maintenance
|
41 | ✔ found 0 problems, 0 warnings
|
42 | ```
|
43 |
|
44 | Consult [docs/rules](https://conventional-changelog.github.io/commitlint/#/reference-rules) for a list of available rules.
|