Skip to content

Commit a3be70c

Browse files
committedFeb 25, 2023
feat(config): add 'extends' configuration option
Give users the option to extend Options with a deep merge with the object inside the "extends" configuration option fix commitizen#145
1 parent bfad899 commit a3be70c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
 

‎index.js

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
var engine = require('./engine');
44
var conventionalCommitTypes = require('conventional-commit-types');
55
var configLoader = require('commitizen').configLoader;
6+
var merge = require('lodash.merge');
67

78
var config = configLoader.load() || {};
89
var options = {
@@ -28,6 +29,10 @@ var options = {
2829
100
2930
};
3031

32+
if (!!config.extends) {
33+
options = merge(options, config.extends);
34+
}
35+
3136
(function(options) {
3237
try {
3338
var commitlintLoad = require('@commitlint/load');

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"commitizen": "^4.0.3",
2626
"conventional-commit-types": "^3.0.0",
2727
"lodash.map": "^4.5.1",
28+
"lodash.merge": "^4.6.2",
2829
"longest": "^2.0.1",
2930
"word-wrap": "^1.0.3"
3031
},

0 commit comments

Comments
 (0)
Please sign in to comment.