File tree Expand file tree Collapse file tree 2 files changed +60
-8
lines changed Expand file tree Collapse file tree 2 files changed +60
-8
lines changed Original file line number Diff line number Diff line change 11# @rocketseat/commitlint-config
22
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+
38Shareable [ ` commitlint ` ] ( https://github.com/conventional-changelog/commitlint ) config used by Rocketseat.
49
5- ## Getting started
10+ ## Install
611
7- Installing:
12+ You can install it with npm or Yarn.
813
914``` sh
1015# 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:
1225
13- # yarn
14- yarn add -D @rocketseat/commitlint-config
26+ ``` sh
27+ echo " module.exports = { extends: [' @rocketseat/commitlint-config'] }; " > .commitlintrc.js
1528```
1629
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.
1833
1934``` 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+
2158```
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 )
Original file line number Diff line number Diff line change 11{
22 "name" : " @rocketseat/commitlint-config" ,
3- "version" : " 0.0.1 " ,
3+ "version" : " 0.0.2 " ,
44 "description" : " Shareable commitlint config used by Rocketseat" ,
55 "main" : " index.js" ,
66 "license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments