Skip to content

Commit

Permalink
fix: wrong nested package.json could be resolve
Browse files Browse the repository at this point in the history
close #741
  • Loading branch information
JounQin committed Nov 20, 2023
1 parent 80cbef4 commit 2b984b3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/options-manager.js
Expand Up @@ -108,7 +108,13 @@ const mergeWithFileConfig = async options => {
}

const searchPath = options.filePath || options.cwd;
const {config: xoOptions, filepath: xoConfigPath} = (await configExplorer.search(searchPath)) || {};
let {config: xoOptions, filepath: xoConfigPath} = (await configExplorer.search(searchPath)) || {};

// Wrong nested `package.json` resolved
if (!xoOptions && xoConfigPath) {
({config: xoOptions, filepath: xoConfigPath} = (await configExplorer.search(path.resolve(xoConfigPath, '../..'))) || {});
}

const {config: enginesOptions} = (await pkgConfigExplorer.search(searchPath)) || {};

options = normalizeOptions({
Expand Down

0 comments on commit 2b984b3

Please sign in to comment.