From 9be68395392c0c95a5672810c9530db8f315bf06 Mon Sep 17 00:00:00 2001 From: Ahmad Awais Date: Sat, 15 Sep 2018 16:53:19 +0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20NEW:=20commit=20lint=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .commitlintrc.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .commitlintrc.js diff --git a/.commitlintrc.js b/.commitlintrc.js new file mode 100644 index 0000000..6176ae2 --- /dev/null +++ b/.commitlintrc.js @@ -0,0 +1,31 @@ +/** + * Commit Lint + * + * Rules are made up by a name and a configuration array. + * The configuration array contains: + * 1. Level: | [0..2] | 0 = disables | 1 = considered a warning | 2 an error for the rule. + * 2. Applicable: | always/never | never inverts the rule. + * 3. Value: | value to use for this rule. + * + * @link https://github.com/marionebl/commitlint/blob/master/docs/reference-rules.md + */ + +module.exports = { + parserPreset: { + parserOpts: { + headerPattern: /^(.*\w*): (.*)$/, + headerCorrespondence: ['type', 'subject'] + } + }, + rules: { + 'body-leading-blank': [1, 'always'], + 'footer-leading-blank': [1, 'always'], + 'header-max-length': [2, 'always', 72], + 'scope-case': [2, 'always', 'lower-case'], // ? + 'subject-empty': [2, 'never'], + 'subject-full-stop': [2, 'never', '.'], + 'type-empty': [2, 'never'], + 'type-case': [2, 'always', 'upper-case'], + 'type-enum': [2, 'always', ['📦 NEW', '👌 IMPROVE', '🐛 FIX', '🚀 RELEASE', '🦄 RELEASE', '📖 DOC', '✅ TEST']] + } +};