Skip to content

Commit

Permalink
fix(yarn): Don't parse empty yarnrc files (#25609)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Nov 6, 2023
1 parent 4231b1a commit e702895
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/modules/manager/npm/extract/index.ts
Expand Up @@ -127,13 +127,13 @@ export async function extractPackageFile(

let yarnConfig: YarnConfig | null = null;
const repoYarnrcYml = await readLocalFile(yarnrcYmlFileName, 'utf8');
if (is.string(repoYarnrcYml)) {
if (is.string(repoYarnrcYml) && repoYarnrcYml.trim().length > 0) {
yarnConfig = loadConfigFromYarnrcYml(repoYarnrcYml);
}

const legacyYarnrcFileName = getSiblingFileName(packageFile, '.yarnrc');
const repoLegacyYarnrc = await readLocalFile(legacyYarnrcFileName, 'utf8');
if (is.string(repoLegacyYarnrc)) {
if (is.string(repoLegacyYarnrc) && repoLegacyYarnrc.trim().length > 0) {
yarnConfig = loadConfigFromLegacyYarnrc(repoLegacyYarnrc);
}

Expand Down

0 comments on commit e702895

Please sign in to comment.