Skip to content

Commit

Permalink
refactor: use config.root instead of cwd where feasible
Browse files Browse the repository at this point in the history
  • Loading branch information
apaleslimghost committed Nov 8, 2024
1 parent a22b46c commit e90de8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/cli/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion core/cli/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`])
Expand Down

0 comments on commit e90de8b

Please sign in to comment.