File tree 1 file changed +59
-7
lines changed
1 file changed +59
-7
lines changed Original file line number Diff line number Diff line change 1
1
# @rocketseat/commitlint-config
2
2
3
+ <p >
4
+ <img src =" https://img.shields.io/npm/v/@rocketseat/commitlint-config?style=flat-square&color=8257E5&labelColor=121214 " alt =" npm version " />
5
+ <img alt =" License " src =" https://img.shields.io/github/license/rocketseat/commitlint-config?style=flat-square&color=8257E5&labelColor=121214 " >
6
+ </p >
7
+
3
8
Shareable [ ` commitlint ` ] ( https://github.com/conventional-changelog/commitlint ) config used by Rocketseat.
4
9
5
- ## Getting started
10
+ ## Install
6
11
7
- Installing:
12
+ You can install it with npm or Yarn.
8
13
9
14
``` sh
10
15
# npm
11
- npm i -D @rocketseat/commitlint-config
16
+ npm i -D @rocketseat/commitlint-config @commitlint/cli
17
+
18
+ # Yarn
19
+ yarn add -D @rocketseat/commitlint-config @commitlint/cli
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ After installing it, apply the config to ` commitlint ` by running the following command:
12
25
13
- # yarn
14
- yarn add -D @rocketseat/commitlint-config
26
+ ``` sh
27
+ echo " module.exports = { extends: [' @rocketseat/commitlint-config'] }; " > .commitlintrc.js
15
28
```
16
29
17
- Apply the config to ` commitlint ` :
30
+ ## Bonus
31
+
32
+ To lint commits before they are created, install Husky and use the 'commit-msg' hook.
18
33
19
34
``` sh
20
- echo " module.exports = {extends: ['@rocketseat/commitlint-config']};" > commitlint.config.js
35
+ # Npm
36
+ npm i -D husky
37
+
38
+ # Yarn
39
+ yarn add -D husky
40
+ ```
41
+
42
+ After that, you can create a ` .huskyrc ` file or add to your ` package.json ` the following code for
43
+
44
+ Husky v4:
45
+
46
+ ``` json
47
+ {
48
+ "husky" : {
49
+ "hooks" : {
50
+ "commit-msg" : " commitlint -E HUSKY_GIT_PARAMS"
51
+ }
52
+ }
53
+ }
54
+ ```
55
+
56
+ Husky v5:
57
+
21
58
```
59
+ # .husky/commit-msg
60
+ # ...
61
+ npx --no-install commitlint --edit $1
62
+ # or
63
+ yarn commitlint --edit $1
64
+ ```
65
+
66
+ ## Version Support
67
+
68
+ - Node.js [ LTS] ( https://github.com/nodejs/LTS#lts-schedule ) ` >= 10.21.0 `
69
+ - git ` >= 2.13.2 `
70
+
71
+ ## License
72
+
73
+ MIT License © [ Rocketseat] ( https://github.com/Rocketseat )
You can’t perform that action at this time.
0 commit comments