Skip to content

Commit

Permalink
Merge pull request #5 from Rocketseat/docs/improve-instructions
Browse files Browse the repository at this point in the history
docs: Improve instructions on README
  • Loading branch information
pellizzetti authored Jan 27, 2021
2 parents f0f72cc + 455fb7c commit fe5ee0b
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 8 deletions.
66 changes: 59 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,73 @@
# @rocketseat/commitlint-config

<p>
<img src="https://img.shields.io/npm/v/@rocketseat/commitlint-config?style=flat-square&color=8257E5&labelColor=121214" alt="npm version" />
<img alt="License" src="https://img.shields.io/github/license/rocketseat/commitlint-config?style=flat-square&color=8257E5&labelColor=121214">
</p>

Shareable [`commitlint`](https://github.com/conventional-changelog/commitlint) config used by Rocketseat.

## Getting started
## Install

Installing:
You can install it with npm or Yarn.

```sh
# npm
npm i -D @rocketseat/commitlint-config
npm i -D @rocketseat/commitlint-config @commitlint/cli

# Yarn
yarn add -D @rocketseat/commitlint-config @commitlint/cli
```

## Usage

After installing it, apply the config to `commitlint` by running the following command:

# yarn
yarn add -D @rocketseat/commitlint-config
```sh
echo "module.exports = { extends: ['@rocketseat/commitlint-config'] };" > .commitlintrc.js
```

Apply the config to `commitlint`:
## Bonus

To lint commits before they are created, install Husky and use the 'commit-msg' hook.

```sh
echo "module.exports = {extends: ['@rocketseat/commitlint-config']};" > commitlint.config.js
# Npm
npm i -D husky

# Yarn
yarn add -D husky
```

After that, you can create a `.huskyrc` file or add to your `package.json` the following code for

Husky v4:

```json
{
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
```

Husky v5:

```
# .husky/commit-msg
# ...
npx --no-install commitlint --edit $1
# or
yarn commitlint --edit $1
```

## Version Support

- Node.js [LTS](https://github.com/nodejs/LTS#lts-schedule) `>= 10.21.0`
- git `>= 2.13.2`

## License

MIT License © [Rocketseat](https://github.com/Rocketseat)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rocketseat/commitlint-config",
"version": "0.0.1",
"version": "0.0.2",
"description": "Shareable commitlint config used by Rocketseat",
"main": "index.js",
"license": "MIT",
Expand Down

0 comments on commit fe5ee0b

Please sign in to comment.