From 8829b33d630eedbeb868b147bc681960d285c348 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Fri, 7 Oct 2016 15:19:56 +0700 Subject: [PATCH] improve error message when extended config doesn't existn --- options-manager.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/options-manager.js b/options-manager.js index e3a6acd2..1daa0d77 100644 --- a/options-manager.js +++ b/options-manager.js @@ -131,7 +131,13 @@ function buildConfig(opts) { name = `eslint-config-${name}`; } - return resolveFrom(opts.cwd, name); + const ret = resolveFrom(opts.cwd, name); + + if (!ret) { + throw new Error(`Couldn't find ESLint config: ${name}`); + } + + return ret; }); config.baseConfig.extends = config.baseConfig.extends.concat(configs);