@commitlint/resolve-extends
Advanced tools
Comparing version
@@ -6,2 +6,13 @@ # Change Log | ||
# [15.0.0](https://github.com/conventional-changelog/commitlint/compare/v14.2.0...v15.0.0) (2021-11-17) | ||
### Features | ||
* simplify config resolution ([#2398](https://github.com/conventional-changelog/commitlint/issues/2398)) ([8a8384f](https://github.com/conventional-changelog/commitlint/commit/8a8384f3c18954447cb633e76a573e1db71a1440)), closes [#327](https://github.com/conventional-changelog/commitlint/issues/327) | ||
# [14.1.0](https://github.com/conventional-changelog/commitlint/compare/v14.0.0...v14.1.0) (2021-11-01) | ||
@@ -8,0 +19,0 @@ |
@@ -7,3 +7,2 @@ import 'resolve-global'; | ||
export interface ResolveExtendsConfig { | ||
parserPreset?: unknown; | ||
extends?: string | string[]; | ||
@@ -24,3 +23,3 @@ helpUrl?: string; | ||
} | ||
export default function resolveExtends(config?: ResolveExtendsConfig, context?: ResolveExtendsContext): ResolvedConfig & ResolveExtendsConfig; | ||
export default function resolveExtends(config?: ResolveExtendsConfig, context?: ResolveExtendsContext): ResolvedConfig; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -25,6 +25,13 @@ "use strict"; | ||
const { extends: e } = config; | ||
const extended = loadExtends(config, context).reduce((r, _a) => { | ||
const extended = loadExtends(config, context); | ||
extended.push(config); | ||
return extended.reduce((r, _a) => { | ||
var { extends: _ } = _a, c = __rest(_a, ["extends"]); | ||
return (0, mergeWith_1.default)(r, c, (objValue, srcValue) => { | ||
if (Array.isArray(objValue)) { | ||
return (0, mergeWith_1.default)(r, c, (objValue, srcValue, key) => { | ||
if (key === 'plugins') { | ||
if (Array.isArray(objValue)) { | ||
return objValue.concat(srcValue); | ||
} | ||
} | ||
else if (Array.isArray(objValue)) { | ||
return srcValue; | ||
@@ -34,3 +41,2 @@ } | ||
}, e ? { extends: e } : {}); | ||
return (0, merge_1.default)({}, extended, config); | ||
} | ||
@@ -37,0 +43,0 @@ exports.default = resolveExtends; |
{ | ||
"name": "@commitlint/resolve-extends", | ||
"version": "14.1.0", | ||
"version": "15.0.0", | ||
"description": "Lint your commit messages", | ||
@@ -38,3 +38,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@commitlint/utils": "^14.0.0", | ||
"@commitlint/utils": "^15.0.0", | ||
"@types/lodash": "^4.14.161" | ||
@@ -48,3 +48,3 @@ }, | ||
}, | ||
"gitHead": "3882bd1680197f0ec4c40e4c9955911e20647488" | ||
"gitHead": "399a0289356c670a87524387cc96d8fb0a33fdca" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
21911
3.17%141
3.68%