From 385046aaa72ae0d664dc57c806bbb240459209f2 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Tue, 19 Apr 2022 03:08:44 -0700 Subject: [PATCH] improve legacy config warning message (#3142) --- packages/astro/src/core/config.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/astro/src/core/config.ts b/packages/astro/src/core/config.ts index dd33919d8..57b45ef1b 100644 --- a/packages/astro/src/core/config.ts +++ b/packages/astro/src/core/config.ts @@ -233,16 +233,16 @@ export async function validateConfig( process.exit(1); } - let oldConfig = false; + let legacyConfigKey: string | undefined; for (const key of Object.keys(userConfig)) { if (LEGACY_ASTRO_CONFIG_KEYS.has(key)) { - oldConfig = true; + legacyConfigKey = key; break; } } - if (oldConfig) { + if (legacyConfigKey) { throw new Error( - `Legacy configuration detected. Please update your configuration to the new format!\nSee https://astro.build/config for more information.` + `Legacy configuration detected: "${legacyConfigKey}".\nPlease update your configuration to the new format!\nSee https://astro.build/config for more information.` ); } /* eslint-enable no-console */