@commitlint/is-ignored 7.1.0 → 7.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,34 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ <a name="7.2.1"></a>
7
+ ## [7.2.1](https://github.com/marionebl/commitlint/compare/v7.2.0...v7.2.1) (2018-10-11)
8
+
9
+
10
+
11
+
12
+ **Note:** Version bump only for package @commitlint/is-ignored
13
+
14
+ <a name="7.2.0"></a>
15
+ # [7.2.0](https://github.com/marionebl/commitlint/compare/v7.1.2...v7.2.0) (2018-10-05)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * ignore merge messages with text after newline ([b32bc93](https://github.com/marionebl/commitlint/commit/b32bc93))
21
+ * use grouped regex to ignore merge commits ([#439](https://github.com/marionebl/commitlint/issues/439)) ([905e9d5](https://github.com/marionebl/commitlint/commit/905e9d5))
22
+
23
+
24
+
25
+
26
+ <a name="7.1.2"></a>
27
+ ## [7.1.2](https://github.com/marionebl/commitlint/compare/v7.1.1...v7.1.2) (2018-09-04)
28
+
29
+
30
+
31
+
32
+ **Note:** Version bump only for package @commitlint/is-ignored
33
+
6
34
  <a name="7.1.0"></a>
7
35
  # [7.1.0](https://github.com/marionebl/commitlint/compare/v7.0.1...v7.1.0) (2018-08-29)
8
36
 
package/lib/index.js CHANGED
@@ -11,7 +11,7 @@ var _semver2 = _interopRequireDefault(_semver);
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
- const WILDCARDS = [c => c.match(/^(Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?))(?:\r?\n)*$)/), c => c.match(/^(R|r)evert (.*)/), c => c.match(/^(fixup|squash)!/), c => _semver2.default.valid(c.split('\n').shift().replace(/^chore(\([^)]+\))?:/, '').trim()), c => c.match(/^Merged (.*?)(in|into) (.*)/), c => c.match(/^Merge remote-tracking branch (.*)/), c => c.match(/^Automatic merge from (.*)/), c => c.match(/^Auto-merged (.*?) into (.*)/)];
14
+ const WILDCARDS = [c => c.match(/^((Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?)))(?:\r?\n)*$)/m), c => c.match(/^(R|r)evert (.*)/), c => c.match(/^(fixup|squash)!/), c => _semver2.default.valid(c.split('\n').shift().replace(/^chore(\([^)]+\))?:/, '').trim()), c => c.match(/^Merged (.*?)(in|into) (.*)/), c => c.match(/^Merge remote-tracking branch (.*)/), c => c.match(/^Automatic merge from (.*)/), c => c.match(/^Auto-merged (.*?) into (.*)/)];
15
15
 
16
16
  function isIgnored(commit = '') {
17
17
  return WILDCARDS.some(w => w(commit));
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["isIgnored","WILDCARDS","c","match","valid","split","shift","replace","trim","commit","some","w"],"mappings":";;;;;kBAuBwBA,S;;AAvBxB;;;;;;AAEA,MAAMC,YAAY,CACjBC,KACCA,EAAEC,KAAF,CACC,gFADD,CAFgB,EAKjBD,KAAKA,EAAEC,KAAF,CAAQ,kBAAR,CALY,EAMjBD,KAAKA,EAAEC,KAAF,CAAQ,kBAAR,CANY,EAOjBD,KACC,iBAAOE,KAAP,CACCF,EACEG,KADF,CACQ,IADR,EAEEC,KAFF,GAGEC,OAHF,CAGU,qBAHV,EAGiC,EAHjC,EAIEC,IAJF,EADD,CARgB,EAejBN,KAAKA,EAAEC,KAAF,CAAQ,6BAAR,CAfY,EAgBjBD,KAAKA,EAAEC,KAAF,CAAQ,oCAAR,CAhBY,EAiBjBD,KAAKA,EAAEC,KAAF,CAAQ,4BAAR,CAjBY,EAkBjBD,KAAKA,EAAEC,KAAF,CAAQ,8BAAR,CAlBY,CAAlB;;AAqBe,SAASH,SAAT,CAAmBS,SAAS,EAA5B,EAAgC;AAC9C,QAAOR,UAAUS,IAAV,CAAeC,KAAKA,EAAEF,MAAF,CAApB,CAAP;AACA","file":"index.js","sourcesContent":["import semver from 'semver';\n\nconst WILDCARDS = [\n\tc =>\n\t\tc.match(\n\t\t\t/^(Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?))(?:\\r?\\n)*$)/\n\t\t),\n\tc => c.match(/^(R|r)evert (.*)/),\n\tc => c.match(/^(fixup|squash)!/),\n\tc =>\n\t\tsemver.valid(\n\t\t\tc\n\t\t\t\t.split('\\n')\n\t\t\t\t.shift()\n\t\t\t\t.replace(/^chore(\\([^)]+\\))?:/, '')\n\t\t\t\t.trim()\n\t\t),\n\tc => c.match(/^Merged (.*?)(in|into) (.*)/),\n\tc => c.match(/^Merge remote-tracking branch (.*)/),\n\tc => c.match(/^Automatic merge from (.*)/),\n\tc => c.match(/^Auto-merged (.*?) into (.*)/)\n];\n\nexport default function isIgnored(commit = '') {\n\treturn WILDCARDS.some(w => w(commit));\n}\n"]}
1
+ {"version":3,"sources":["../src/index.js"],"names":["isIgnored","WILDCARDS","c","match","valid","split","shift","replace","trim","commit","some","w"],"mappings":";;;;;kBAuBwBA,S;;AAvBxB;;;;;;AAEA,MAAMC,YAAY,CACjBC,KACCA,EAAEC,KAAF,CACC,mFADD,CAFgB,EAKjBD,KAAKA,EAAEC,KAAF,CAAQ,kBAAR,CALY,EAMjBD,KAAKA,EAAEC,KAAF,CAAQ,kBAAR,CANY,EAOjBD,KACC,iBAAOE,KAAP,CACCF,EACEG,KADF,CACQ,IADR,EAEEC,KAFF,GAGEC,OAHF,CAGU,qBAHV,EAGiC,EAHjC,EAIEC,IAJF,EADD,CARgB,EAejBN,KAAKA,EAAEC,KAAF,CAAQ,6BAAR,CAfY,EAgBjBD,KAAKA,EAAEC,KAAF,CAAQ,oCAAR,CAhBY,EAiBjBD,KAAKA,EAAEC,KAAF,CAAQ,4BAAR,CAjBY,EAkBjBD,KAAKA,EAAEC,KAAF,CAAQ,8BAAR,CAlBY,CAAlB;;AAqBe,SAASH,SAAT,CAAmBS,SAAS,EAA5B,EAAgC;AAC9C,QAAOR,UAAUS,IAAV,CAAeC,KAAKA,EAAEF,MAAF,CAApB,CAAP;AACA","file":"index.js","sourcesContent":["import semver from 'semver';\n\nconst WILDCARDS = [\n\tc =>\n\t\tc.match(\n\t\t\t/^((Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?)))(?:\\r?\\n)*$)/m\n\t\t),\n\tc => c.match(/^(R|r)evert (.*)/),\n\tc => c.match(/^(fixup|squash)!/),\n\tc =>\n\t\tsemver.valid(\n\t\t\tc\n\t\t\t\t.split('\\n')\n\t\t\t\t.shift()\n\t\t\t\t.replace(/^chore(\\([^)]+\\))?:/, '')\n\t\t\t\t.trim()\n\t\t),\n\tc => c.match(/^Merged (.*?)(in|into) (.*)/),\n\tc => c.match(/^Merge remote-tracking branch (.*)/),\n\tc => c.match(/^Automatic merge from (.*)/),\n\tc => c.match(/^Auto-merged (.*?) into (.*)/)\n];\n\nexport default function isIgnored(commit = '') {\n\treturn WILDCARDS.some(w => w(commit));\n}\n"]}
package/lib/index.test.js CHANGED
@@ -48,6 +48,11 @@ const AMENDED_VERSION_MESSAGES = VERSION_MESSAGES.reduce((results, message) => {
48
48
  t.true((0, _2.default)('Merge pull request #369'));
49
49
  });
50
50
 
51
+ (0, _ava2.default)('should return true for branch merges with newline characters and more characters after it', t => {
52
+ t.true((0, _2.default)("Merge branch 'ctrom-YarnBuild'\n "));
53
+ t.true((0, _2.default)("Merge branch 'ctrom-YarnBuild'\r\n # some comment"));
54
+ });
55
+
51
56
  (0, _ava2.default)('should return true for revert commits', t => {
52
57
  t.true((0, _2.default)(`Revert "docs: add recipe for linting of all commits in a PR (#36)"\n\nThis reverts commit 1e69d542c16c2a32acfd139e32efa07a45f19111.`));
53
58
  t.true((0, _2.default)(`revert "docs: add recipe for linting of all commits in a PR (#36)"\n\nThis reverts commit 1e69d542c16c2a32acfd139e32efa07a45f19111.`));
@@ -82,4 +87,8 @@ const AMENDED_VERSION_MESSAGES = VERSION_MESSAGES.reduce((results, message) => {
82
87
  (0, _ava2.default)('should return true for automatic merge commits', t => {
83
88
  t.true((0, _2.default)('Auto-merged develop into master'));
84
89
  });
90
+
91
+ (0, _ava2.default)('should return false for commits containing, but not starting, with merge branch', t => {
92
+ t.false((0, _2.default)('foo bar Merge branch xxx'));
93
+ });
85
94
  //# sourceMappingURL=index.test.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.test.js"],"names":["VERSION_MESSAGES","AMENDMENTS","AMENDED_VERSION_MESSAGES","reduce","results","message","map","amendment","t","false","true","forEach"],"mappings":";;AAAA;;;;AACA;;;;;;AAEA,MAAMA,mBAAmB,CACxB,OADwB,EAExB,OAFwB,EAGxB,OAHwB,EAIxB,aAJwB,EAKxB,sBALwB,EAMxB,SANwB,EAOxB,WAPwB,EAQxB,eARwB,EASxB,iBATwB,EAUxB,wBAVwB,EAWxB,0BAXwB,EAYxB,eAZwB,EAaxB,QAbwB,EAcxB,SAdwB,CAAzB;;AAiBA,MAAMC,aAAa,CAClB,gDADkB,EAElB,sDAFkB,EAGlB,sGAHkB,CAAnB;;AAMA,MAAMC,2BAA2BF,iBAAiBG,MAAjB,CAAwB,CAACC,OAAD,EAAUC,OAAV,KAAsB;AAC9E,QAAO,CACN,GAAGD,OADG,EAEN,GAAGH,WAAWK,GAAX,CAAeC,aAAc,GAAEF,OAAQ,OAAME,SAAU,EAAvD,CAFG,CAAP;AAIA,CALgC,EAK9B,EAL8B,CAAjC;;AAOA,mBAAK,mDAAL,EAA0DC,KAAK;AAC9DA,GAAEC,KAAF,CAAQ,iBAAR;AACA,CAFD;;AAIA,mBAAK,mDAAL,EAA0DD,KAAK;AAC9DA,GAAEC,KAAF,CAAQ,gBAAU,EAAV,CAAR;AACA,CAFD;;AAIA,mBAAK,uCAAL,EAA8CD,KAAK;AAClDA,GAAEC,KAAF,CAAQ,gBAAU,gBAAV,CAAR;AACA,CAFD;;AAIA,mBAAK,sCAAL,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AAEE,IAAF,CAAO,gBAAU,wBAAV,CAAP;AACA,CAFD;;AAIA,mBAAK,gDAAL,EAAuDF,KAAK;AAC3DA,GAAEE,IAAF,CACC,gBAAU,2DAAV,CADD;AAGAF,GAAEE,IAAF,CAAO,gBAAU,wDAAV,CAAP;AACA,CALD;;AAOA,mBAAK,gDAAL,EAAuDF,KAAK;AAC3DA,GAAEE,IAAF,CAAO,gBAAU,iCAAV,CAAP;AACA,CAFD","file":"index.test.js","sourcesContent":["import test from 'ava';\nimport isIgnored from '.';\n\nconst VERSION_MESSAGES = [\n\t'0.0.1',\n\t'0.1.0',\n\t'1.0.0',\n\t'0.0.1-alpha',\n\t'0.0.1-some-crazy-tag',\n\t'0.0.1-0',\n\t'0.0.1-999',\n\t'0.0.1-alpha.0',\n\t'0.0.1-alpha.999',\n\t'0.0.1-some-crazy-tag.0',\n\t'0.0.1-some-crazy-tag.999',\n\t'0.0.1-1e69d54',\n\t'v0.0.1',\n\t' v3.0.0'\n];\n\nconst AMENDMENTS = [\n\t'Signed-off-by: Developer <example@example.com>',\n\t'Change-Id: I895114872a515a269487a683124b63303818e19c',\n\t'Signed-off-by: Developer <example@example.com>\\nChange-Id: I895114872a515a269487a683124b63303818e19c'\n];\n\nconst AMENDED_VERSION_MESSAGES = VERSION_MESSAGES.reduce((results, message) => {\n\treturn [\n\t\t...results,\n\t\t...AMENDMENTS.map(amendment => `${message}\\n\\n${amendment}`)\n\t];\n}, []);\n\ntest('should return false when called without arguments', t => {\n\tt.false(isIgnored());\n});\n\ntest('should return false when called with empty string', t => {\n\tt.false(isIgnored(''));\n});\n\ntest('should return false for normal commit', t => {\n\tt.false(isIgnored('initial commit'));\n});\n\ntest('should return true for branch merges', t => {\n\tt.true(isIgnored(\"Merge branch 'iss53'\"));\n});\n\ntest('should return true for branch merges with newline characters', t => {\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\n\"));\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\r\\n\"));\n});\n\ntest('should return true for branch merges with multiple newline characters', t => {\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\n\\n\\n\"));\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\r\\n\\r\\n\\r\\n\"));\n});\n\ntest('should return true for merged PRs', t => {\n\tt.true(isIgnored('Merge pull request #369'));\n});\n\ntest('should return true for revert commits', t => {\n\tt.true(\n\t\tisIgnored(\n\t\t\t`Revert \"docs: add recipe for linting of all commits in a PR (#36)\"\\n\\nThis reverts commit 1e69d542c16c2a32acfd139e32efa07a45f19111.`\n\t\t)\n\t);\n\tt.true(\n\t\tisIgnored(\n\t\t\t`revert \"docs: add recipe for linting of all commits in a PR (#36)\"\\n\\nThis reverts commit 1e69d542c16c2a32acfd139e32efa07a45f19111.`\n\t\t)\n\t);\n});\n\ntest('should ignore npm semver commits', t => {\n\tVERSION_MESSAGES.forEach(message => t.true(isIgnored(message)));\n});\n\ntest('should ignore npm semver commits with chore', t => {\n\tVERSION_MESSAGES.forEach(message => t.true(isIgnored(`chore: ${message}`)));\n\tVERSION_MESSAGES.forEach(message =>\n\t\tt.true(isIgnored(`chore(release): ${message}`))\n\t);\n});\n\ntest('should ignore npm semver commits with footers', t => {\n\tAMENDED_VERSION_MESSAGES.forEach(message => t.true(isIgnored(message)));\n});\n\ntest('should return true fixup commits', t => {\n\tt.true(isIgnored('fixup! initial commit'));\n});\n\ntest('should return true squash commits', t => {\n\tt.true(isIgnored('squash! initial commit'));\n});\n\ntest('should return true for bitbucket merge commits', t => {\n\tt.true(\n\t\tisIgnored('Merged in feature/facebook-friends-sync (pull request #8)')\n\t);\n\tt.true(isIgnored('Merged develop into feature/component-form-select-card'));\n});\n\ntest('should return true for automatic merge commits', t => {\n\tt.true(isIgnored('Auto-merged develop into master'));\n});\n"]}
1
+ {"version":3,"sources":["../src/index.test.js"],"names":["VERSION_MESSAGES","AMENDMENTS","AMENDED_VERSION_MESSAGES","reduce","results","message","map","amendment","t","false","true","for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EE,IAAF,CAAO,gBAAU,iCAAV,CAAP;AACA,CAFD;;AAIA,mBAAK,iFAAL,EAAwFF,KAAK;AAC5FA,GAAEC,KAAF,CAAQ,gBAAU,0BAAV,CAAR;AACA,CAFD","file":"index.test.js","sourcesContent":["import test from 'ava';\nimport isIgnored from '.';\n\nconst VERSION_MESSAGES = [\n\t'0.0.1',\n\t'0.1.0',\n\t'1.0.0',\n\t'0.0.1-alpha',\n\t'0.0.1-some-crazy-tag',\n\t'0.0.1-0',\n\t'0.0.1-999',\n\t'0.0.1-alpha.0',\n\t'0.0.1-alpha.999',\n\t'0.0.1-some-crazy-tag.0',\n\t'0.0.1-some-crazy-tag.999',\n\t'0.0.1-1e69d54',\n\t'v0.0.1',\n\t' v3.0.0'\n];\n\nconst AMENDMENTS = [\n\t'Signed-off-by: Developer <example@example.com>',\n\t'Change-Id: I895114872a515a269487a683124b63303818e19c',\n\t'Signed-off-by: Developer <example@example.com>\\nChange-Id: I895114872a515a269487a683124b63303818e19c'\n];\n\nconst AMENDED_VERSION_MESSAGES = VERSION_MESSAGES.reduce((results, message) => {\n\treturn [\n\t\t...results,\n\t\t...AMENDMENTS.map(amendment => `${message}\\n\\n${amendment}`)\n\t];\n}, []);\n\ntest('should return false when called without arguments', t => {\n\tt.false(isIgnored());\n});\n\ntest('should return false when called with empty string', t => {\n\tt.false(isIgnored(''));\n});\n\ntest('should return false for normal commit', t => {\n\tt.false(isIgnored('initial commit'));\n});\n\ntest('should return true for branch merges', t => {\n\tt.true(isIgnored(\"Merge branch 'iss53'\"));\n});\n\ntest('should return true for branch merges with newline characters', t => {\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\n\"));\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\r\\n\"));\n});\n\ntest('should return true for branch merges with multiple newline characters', t => {\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\n\\n\\n\"));\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\r\\n\\r\\n\\r\\n\"));\n});\n\ntest('should return true for merged PRs', t => {\n\tt.true(isIgnored('Merge pull request #369'));\n});\n\ntest('should return true for branch merges with newline characters and more characters after it', t => {\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\n \"));\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\r\\n # some comment\"));\n});\n\ntest('should return true for revert commits', t => {\n\tt.true(\n\t\tisIgnored(\n\t\t\t`Revert \"docs: add recipe for linting of all commits in a PR (#36)\"\\n\\nThis reverts commit 1e69d542c16c2a32acfd139e32efa07a45f19111.`\n\t\t)\n\t);\n\tt.true(\n\t\tisIgnored(\n\t\t\t`revert \"docs: add recipe for linting of all commits in a PR (#36)\"\\n\\nThis reverts commit 1e69d542c16c2a32acfd139e32efa07a45f19111.`\n\t\t)\n\t);\n});\n\ntest('should ignore npm semver commits', t => {\n\tVERSION_MESSAGES.forEach(message => t.true(isIgnored(message)));\n});\n\ntest('should ignore npm semver commits with chore', t => {\n\tVERSION_MESSAGES.forEach(message => t.true(isIgnored(`chore: ${message}`)));\n\tVERSION_MESSAGES.forEach(message =>\n\t\tt.true(isIgnored(`chore(release): ${message}`))\n\t);\n});\n\ntest('should ignore npm semver commits with footers', t => {\n\tAMENDED_VERSION_MESSAGES.forEach(message => t.true(isIgnored(message)));\n});\n\ntest('should return true fixup commits', t => {\n\tt.true(isIgnored('fixup! initial commit'));\n});\n\ntest('should return true squash commits', t => {\n\tt.true(isIgnored('squash! initial commit'));\n});\n\ntest('should return true for bitbucket merge commits', t => {\n\tt.true(\n\t\tisIgnored('Merged in feature/facebook-friends-sync (pull request #8)')\n\t);\n\tt.true(isIgnored('Merged develop into feature/component-form-select-card'));\n});\n\ntest('should return true for automatic merge commits', t => {\n\tt.true(isIgnored('Auto-merged develop into master'));\n});\n\ntest('should return false for commits containing, but not starting, with merge branch', t => {\n\tt.false(isIgnored('foo bar Merge branch xxx'));\n});\n"]}
package/license.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 - present Mario Nebl
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commitlint/is-ignored",
3
- "version": "7.1.0",
3
+ "version": "7.2.1",
4
4
  "description": "Lint your commit messages",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -59,12 +59,12 @@
59
59
  },
60
60
  "license": "MIT",
61
61
  "devDependencies": {
62
- "@commitlint/parse": "^7.0.0",
63
- "@commitlint/test": "^7.0.0",
64
- "@commitlint/utils": "^7.0.0",
62
+ "@commitlint/parse": "^7.1.2",
63
+ "@commitlint/test": "^7.1.2",
64
+ "@commitlint/utils": "^7.1.2",
65
65
  "ava": "0.22.0",
66
66
  "babel-cli": "6.26.0",
67
- "babel-preset-commitlint": "^7.0.0",
67
+ "babel-preset-commitlint": "^7.1.2",
68
68
  "babel-register": "6.26.0",
69
69
  "concurrently": "3.5.1",
70
70
  "cross-env": "5.1.1",
@@ -72,6 +72,6 @@
72
72
  "xo": "0.20.3"
73
73
  },
74
74
  "dependencies": {
75
- "semver": "5.5.0"
75
+ "semver": "5.6.0"
76
76
  }
77
77
  }