cherry-pick and fix merge conflicts in #2695 - closes #2695

This commit is contained in:
Sebastian McKenzie
2015-11-08 06:08:18 -08:00
parent d1c4945a13
commit c8901cf98d
2 changed files with 12 additions and 4 deletions

View File

@@ -84,6 +84,11 @@ module.exports = {
type: "boolean"
},
extends: {
type: "string",
hidden: true
},
comments: {
type: "boolean",
default: true,

View File

@@ -128,8 +128,10 @@ export default class OptionManager {
});
}
addConfig(loc: string, key?: string, json = json5) {
if (this.resolvedConfigs.indexOf(loc) >= 0) return;
addConfig(loc: string, key?: string, json = json5): boolean {
if (this.resolvedConfigs.indexOf(loc) >= 0) {
return false;
}
let content = fs.readFileSync(loc, "utf8");
let opts;
@@ -144,6 +146,8 @@ export default class OptionManager {
this.mergeOptions(opts, loc);
this.resolvedConfigs.push(loc);
return !!opts;
}
/**
@@ -272,8 +276,7 @@ export default class OptionManager {
let pkgLoc = path.join(loc, PACKAGE_FILENAME);
if (exists(pkgLoc)) {
this.addConfig(pkgLoc, "babel", JSON);
foundConfig = true;
foundConfig = this.addConfig(pkgLoc, "babel", JSON);
}
}