Skip to content

Commit

Permalink
fix: validate sources value to be string (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Sep 5, 2022
1 parent faa482d commit f97c850
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/loader.ts
Expand Up @@ -137,11 +137,17 @@ async function extendConfig (config, opts: LoadConfigOptions) {
delete config[key]
}
for (const extendSource of extendSources) {
if (typeof extendSource !== 'string') {
// TODO: Use error in next major versions
// eslint-disable-next-line no-console
console.warn(`Cannot extend config from \`${JSON.stringify(extendSource)}\` (which should be a string) in ${opts.cwd}`)
continue
}
const _config = await resolveConfig(extendSource, opts)
if (!_config.config) {
// TODO: Use error in next major versions
// eslint-disable-next-line no-console
console.warn(`Cannot extend config from ${extendSource} in ${opts.cwd}`)
console.warn(`Cannot extend config from \`${extendSource}\` in ${opts.cwd}`)
continue
}
await extendConfig(_config.config, { ...opts, cwd: _config.cwd })
Expand Down

0 comments on commit f97c850

Please sign in to comment.