Skip to content

Commit

Permalink
fix(config): prioritized package.json last when looking for config fi…
Browse files Browse the repository at this point in the history
…les (#484)

since package.json was prioritized first, it is always found and always used, even if it does not contain commitizen config. the other optional config files are never found as a result. this change looks for the optional files first and only lands on the package.json if the other files do not exist

fixes #478
  • Loading branch information
travi authored and jimthedev committed May 24, 2018
1 parent 4b8f29a commit 5f8902e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commitizen/configLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {loader} from '../configLoader';
export { load };

// Configuration sources in priority order.
var configs = ['package.json', '.czrc', '.cz.json'];
var configs = ['.czrc', '.cz.json', 'package.json'];

function load (config, cwd) {
return loader(configs, config, cwd);
Expand Down

0 comments on commit 5f8902e

Please sign in to comment.