From df627a6296a26d824d144261c9ebb30444e01c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Schmitz?= Date: Wed, 27 Jan 2021 09:51:53 -0300 Subject: [PATCH 1/3] docs: Improve instructions on README --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 05fddd9..59eac33 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,73 @@ # @rocketseat/commitlint-config +

+ npm version + License +

+ 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) \ No newline at end of file From 455fb7c1e60ae1825857f6961ffb385863a3f54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Schmitz?= Date: Wed, 27 Jan 2021 10:16:08 -0300 Subject: [PATCH 2/3] chore(release): v0.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8426994..b5d666d 100644 --- a/package.json +++ b/package.json @@ -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", From bb59381bf392d27f6eae4fac5d737ba591316c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Schmitz?= Date: Wed, 17 Feb 2021 18:09:19 -0300 Subject: [PATCH 3/3] chore: allow lower case subject --- index.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 68342f5..b1c500a 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ rules: { "type-case": [2, "always", "lower-case"], "type-enum": [2, "always", ["chore", "ci", "docs", "feat", "fix", "test", "style"]], - "subject-case": [2, "always", "sentence-case"], + "subject-case": [2, "always", ["sentence-case", "lower-case"]], "subject-max-length": [2, "always", 50], "subject-empty": [2, "never"], "subject-full-stop": [2, "never", "."], diff --git a/package.json b/package.json index b5d666d..d98b1dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rocketseat/commitlint-config", - "version": "0.0.2", + "version": "0.0.3", "description": "Shareable commitlint config used by Rocketseat", "main": "index.js", "license": "MIT",