@commitlint/load
Advanced tools
Comparing version 7.2.0 to 7.2.1
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="7.2.1"></a> | ||
## [7.2.1](https://github.com/marionebl/commitlint/compare/v7.2.0...v7.2.1) (2018-10-11) | ||
### Bug Fixes | ||
* improve format module resolving ([#464](https://github.com/marionebl/commitlint/issues/464)) ([baed8b1](https://github.com/marionebl/commitlint/commit/baed8b1)) | ||
<a name="7.2.0"></a> | ||
@@ -8,0 +19,0 @@ # [7.2.0](https://github.com/marionebl/commitlint/compare/v7.1.2...v7.2.0) (2018-10-05) |
@@ -102,5 +102,10 @@ 'use strict'; | ||
// Execute rule config functions if needed | ||
// Resolve config-relative formatter module | ||
function $If_2() { | ||
if (typeof config.formatter === 'string') { | ||
preset.formatter = _resolveFrom2.default.silent(base, config.formatter) || config.formatter; | ||
} | ||
// Execute rule config functions if needed | ||
return Promise.resolve(Promise.all(['rules'].map(key => [key, preset[key]]).map(item => new Promise(function ($return, $error) { | ||
@@ -107,0 +112,0 @@ var _item, key, value, executedValue; |
@@ -13,2 +13,6 @@ 'use strict'; | ||
var _resolveFrom = require('resolve-from'); | ||
var _resolveFrom2 = _interopRequireDefault(_resolveFrom); | ||
var _ = require('.'); | ||
@@ -553,2 +557,54 @@ | ||
}.bind(this))); | ||
(0, _ava2.default)('resolves formatter relative from config directory', t => new Promise(function ($return, $error) { | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/formatter-local-module')).then(function ($await_43) { | ||
try { | ||
cwd = $await_43; | ||
return Promise.resolve((0, _2.default)({}, { cwd })).then(function ($await_44) { | ||
try { | ||
actual = $await_44; | ||
t.deepEqual(actual, { | ||
formatter: (0, _resolveFrom2.default)(cwd, './formatters/custom.js'), | ||
extends: [], | ||
rules: {} | ||
}); | ||
return $return(); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
}.bind(this))); | ||
(0, _ava2.default)('returns formatter name when unable to resolve from config directory', t => new Promise(function ($return, $error) { | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/formatter-local-module')).then(function ($await_45) { | ||
try { | ||
cwd = $await_45; | ||
return Promise.resolve((0, _2.default)({ formatter: './doesnt/exists.js' }, { cwd })).then(function ($await_46) { | ||
try { | ||
actual = $await_46; | ||
t.deepEqual(actual, { | ||
formatter: './doesnt/exists.js', | ||
extends: [], | ||
rules: {} | ||
}); | ||
return $return(); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
}.bind(this))); | ||
//# sourceMappingURL=index.test.js.map |
{ | ||
"name": "@commitlint/load", | ||
"version": "7.2.0", | ||
"version": "7.2.1", | ||
"description": "Load shared commitlint configuration", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51323
735