Remove unnecessary function.

This commit is contained in:
Logan Smyth 2017-09-26 17:57:07 -07:00
parent 073a0dc823
commit 2d7cda4d28

View File

@ -37,7 +37,16 @@ export default function buildConfigChain(opts: {}): Array<ConfigItem> | null {
// resolve all .babelrc files
if (opts.babelrc !== false && filename) {
builder.findConfigs(filename);
findConfigs(
path.dirname(filename),
).forEach(({ filepath, dirname, options }) => {
builder.mergeConfig({
type: "options",
options,
alias: filepath,
dirname,
});
});
}
} catch (e) {
if (e.code !== "BABEL_IGNORED_FILE") throw e;
@ -56,17 +65,6 @@ class ConfigChainBuilder {
this.file = file;
}
findConfigs(loc: string) {
findConfigs(path.dirname(loc)).forEach(({ filepath, dirname, options }) => {
this.mergeConfig({
type: "options",
options,
alias: filepath,
dirname,
});
});
}
mergeConfig({ type, options: rawOpts, alias, dirname }) {
if (rawOpts.ignore != null && !Array.isArray(rawOpts.ignore)) {
throw new Error(