File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ const report = lint(
7777
7878# ## Recipes
7979
80- * As a git ` commitmsg` hook with husky
80+ * As a ` commitmsg` git- hook with [ " husky" ](https://git.io/JDwyQg)
8181
8282` ` ` json
8383 {
@@ -99,13 +99,17 @@ const report = lint(
9999
100100# # Configuration
101101
102- ` conventional-changelog-lint` allows detailed configuration via
102+ ` conventional-changelog-lint` is configured via
103103` .conventional-changelog-lintrc` and shareable configuration.
104- By default it will use the
104+
105+ When no ` .conventional-changelog-lintrc` is found it will use the
105106[angular](https://github.com/marionebl/conventional-changelog-lint-config-angular#rules)
106107shareable config.
107108See the documentation there for default rules.
108109
110+ When a ` .conventional-changelog-lintrc` is found it will ** not** load any preset
111+ unless specified via [extends](# extends) configuration.
112+
109113# ## extends
110114
111115` ` ` js
@@ -150,8 +154,9 @@ for details
150154 }
151155}
152156` ` `
157+
153158Rules applicable to the linted commit messages.
154- By default all rules are disabled via a level of 0.
159+ By default all rules are turned off via a level of 0.
155160They can be enabled by shareable configuration,
156161such as the
157162[angular config](https://github.com/marionebl/conventional-changelog-lint-config-angular),
Original file line number Diff line number Diff line change @@ -15,9 +15,18 @@ const defaultSettings = {
1515} ;
1616
1717export default async ( name = defaultName , settings = defaultSettings , seed = { } ) => {
18+ // Obtain config from .rc files
19+ const userConfig = rc ( name , settings . defaults ) ;
20+
21+ // Use the default extends config if there is no userConfig
22+ // See https://git.io/vwT1C for reference
23+ const applicableDefaults = userConfig ?
24+ { } :
25+ defaults ;
26+
1827 // Merge passed config with file based options
19- const config = merge ( rc ( name , settings . defaults ) , seed ) ;
20- const opts = merge ( { } , defaults , pick ( config , 'extends' ) ) ;
28+ const config = merge ( userConfig , seed ) ;
29+ const opts = merge ( { } , applicableDefaults , pick ( config , 'extends' ) ) ;
2130
2231 // Resolve extends key
2332 const extended = resolveExtends ( opts , settings . prefix ) ;
You can’t perform that action at this time.
0 commit comments