From 98be5c96fcd0f3ac49f1d63d882d9206d86f9013 Mon Sep 17 00:00:00 2001 From: Oscar Dominguez Date: Sat, 27 Nov 2021 19:13:20 +0100 Subject: [PATCH] feat(config): extends option tries to require("") if is a string instead of an object --- index.js | 5 ++++- package-lock.json | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index a526cfd3..3c5307d2 100644 --- a/index.js +++ b/index.js @@ -30,7 +30,10 @@ var options = { }; if (!!config.extends) { - options = merge(options, config.extends); + options = merge( + options, + typeof config.extends == 'string' ? require(config.extends) : config.extends + ); } (function(options) { diff --git a/package-lock.json b/package-lock.json index 8a9bc283..47573b0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "commitizen": "^4.0.3", "conventional-commit-types": "^3.0.0", "lodash.map": "^4.5.1", + "lodash.merge": "^4.6.2", "longest": "^2.0.1", "word-wrap": "^1.0.3" }, @@ -2837,6 +2838,11 @@ "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=" }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "node_modules/lodash.uniqby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", @@ -9976,6 +9982,11 @@ "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=" }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "lodash.uniqby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz",