Skip to content

docs: Improve instructions on README #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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