From 2d7cda4d285264be46c216c465f41952f8e209ab Mon Sep 17 00:00:00 2001 From: Logan Smyth Date: Tue, 26 Sep 2017 17:57:07 -0700 Subject: [PATCH] Remove unnecessary function. --- .../src/config/build-config-chain.js | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/babel-core/src/config/build-config-chain.js b/packages/babel-core/src/config/build-config-chain.js index 6f7364d0e2..fe213f439d 100644 --- a/packages/babel-core/src/config/build-config-chain.js +++ b/packages/babel-core/src/config/build-config-chain.js @@ -37,7 +37,16 @@ export default function buildConfigChain(opts: {}): Array | 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(