From 3a09db22ac2191e09f28988e7c70cba22f585698 Mon Sep 17 00:00:00 2001 From: "epexa@bk.ru" Date: Sat, 6 Feb 2021 14:41:25 +0800 Subject: [PATCH] chore(commit): add commitlint and husky for conventional commits https://www.conventionalcommits.org ISSUE #348 --- .huskyrc | 3 +++ commitlint.config.js | 6 ++++++ package.json | 3 +++ 3 files changed, 12 insertions(+) create mode 100644 .huskyrc create mode 100644 commitlint.config.js diff --git a/.huskyrc b/.huskyrc new file mode 100644 index 000000000..49be2a8c8 --- /dev/null +++ b/.huskyrc @@ -0,0 +1,3 @@ +"hooks": { + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" +} diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 000000000..16f600feb --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,6 @@ +module.exports = { + rules: { + 'scope-empty': [2, 'never'] + }, + extends: ['@commitlint/config-conventional'] +}; diff --git a/package.json b/package.json index 2e4876f10..b3e1c92f1 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,8 @@ "@babel/preset-env": "^7.2.3", "@babel/preset-react": "^7.0.0", "@chainapsis/cosmosjs": "git+https://github.com/litvintech/cosmosjs-dist.git", + "@commitlint/cli": "^11.0.0", + "@commitlint/config-conventional": "^11.0.0", "axios": "^0.19.0", "babel-eslint": "^10.0.1", "babel-loader": "^8.0.5", @@ -36,6 +38,7 @@ "file-loader": "^2.0.0", "history": "^4.9.0", "html-webpack-plugin": "^3.2.0", + "husky": "^4.3.8", "mini-css-extract-plugin": "^0.8.0", "ncp": "^2.0.0", "prettier": "^2.0.5",