Remove unnecessary function.
This commit is contained in:
parent
073a0dc823
commit
2d7cda4d28
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user