From e90de8b699ea5e03f9eb5cf2dd075249aa8dcce6 Mon Sep 17 00:00:00 2001 From: Kara Brightwell Date: Fri, 8 Nov 2024 09:41:11 +0000 Subject: [PATCH] refactor: use config.root instead of cwd where feasible --- core/cli/src/config.ts | 4 ++-- core/cli/src/plugin.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/cli/src/config.ts b/core/cli/src/config.ts index 9eab24e9d..e56d24d4f 100644 --- a/core/cli/src/config.ts +++ b/core/cli/src/config.ts @@ -96,7 +96,7 @@ export function validateConfig(config: ValidPluginsConfig): ValidConfig { const unusedPluginOptions = Object.entries(config.pluginOptions) .filter( ([, option]) => - option && !isConflict(option) && !option.forPlugin && option.plugin.root === process.cwd() + option && !isConflict(option) && !option.forPlugin && option.plugin.root === config.root ) .map(([id]) => id) @@ -107,7 +107,7 @@ export function validateConfig(config: ValidPluginsConfig): ValidConfig { const unusedTaskOptions = Object.entries(config.taskOptions) .filter( - ([, option]) => option && !isConflict(option) && !option.task && option.plugin.root === process.cwd() + ([, option]) => option && !isConflict(option) && !option.task && option.plugin.root === config.root ) .map(([id]) => id) diff --git a/core/cli/src/plugin.ts b/core/cli/src/plugin.ts index 4b7101d8d..3e4453497 100644 --- a/core/cli/src/plugin.ts +++ b/core/cli/src/plugin.ts @@ -37,7 +37,7 @@ export async function loadPlugin( const isAppRoot = id === 'app root' // load plugin relative to the parent plugin - const root = parent ? parent.root : process.cwd() + const root = parent ? parent.root : config.root const pluginRoot = isAppRoot ? root : resolveRoot(id, root) if (!pluginRoot) { return invalid([`could not find path for name ${s.filepath(id)}`])