From 9122172f95512ade7835372995704390879312d9 Mon Sep 17 00:00:00 2001 From: Landon Abney Date: Wed, 3 Jan 2018 14:24:10 -0800 Subject: [PATCH] build(git): enable commitlint Add a configuration for `commitlint` that enforces Angular-like commit messages in preparation for adding of `semantic-release`. --- .travis.yml | 7 ++++++- commitlint.config.js | 5 +++++ package.json | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 commitlint.config.js diff --git a/.travis.yml b/.travis.yml index 4301e00..0da31d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ ### Project specific config ### -language: generic +language: node_js +node_js: + - "8" env: matrix: @@ -9,6 +11,9 @@ env: os: - linux +before_script: + - commitlint-travis + ### Generic setup follows ### dist: trusty diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..f37b7d2 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,5 @@ +module.exports = { + extends: [ + '@commitlint/config-conventional', + ], +}; diff --git a/package.json b/package.json index 9f50524..49b1a85 100644 --- a/package.json +++ b/package.json @@ -43,11 +43,18 @@ "resolve": "^1.5.0" }, "devDependencies": { + "@commitlint/config-conventional": "^5.2.3", + "@commitlint/travis-cli": "^5.2.8", + "commitlint": "^5.2.8", "eslint": "^4.14.0", "eslint-config-airbnb-base": "^12.1.0", "eslint-plugin-import": "^2.8.0", + "husky": "^0.14.3", "jasmine-fix": "^1.3.1" }, + "scripts": { + "commitmsg": "commitlint -e $GIT_PARAMS" + }, "eslintConfig": { "rules": { "global-require": "off",