Files
Sebastian Poxhofer 9717259ffc refactor(oxlint): enable no-else-return and unicorn/no-lonely-if (#44553)
Enable no-else-return (with allowElseIf: false) and unicorn/no-lonely-if
as errors in .oxlintrc.json and fix all 131 pre-existing violations
(91 no-else-return, 40 unicorn/no-lonely-if) across 98 files.

The no-else-return violations were fixed with the oxlint autofix
(iterated to a fixpoint, plus two else-if chains that required
--fix-dangerously) followed by Prettier formatting. One comment dropped
by the autofix in lib/modules/manager/pub/artifacts.ts was restored
manually. The unicorn/no-lonely-if violations were merged by hand,
preserving comments and coverage-ignore hints.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 12:11:21 +00:00

32 lines
827 B
TypeScript

import { logger } from '../../../../../logger/index.ts';
import type { Upgrade } from '../../../types.ts';
export function getNewGitValue(upgrade: Upgrade): string | null {
if (!upgrade.currentRawValue) {
return null;
}
if (upgrade.currentDigest) {
logger.debug('Updating git digest');
return upgrade.currentRawValue.replace(
upgrade.currentDigest,
// TODO #22198
upgrade.newDigest!.substring(0, upgrade.currentDigest.length),
);
}
logger.debug('Updating git version tag');
return upgrade.currentRawValue.replace(
upgrade.currentValue,
upgrade.newValue,
);
}
export function getNewNpmAliasValue(
value: string | undefined,
upgrade: Upgrade,
): string | null {
if (!upgrade.npmPackageAlias) {
return null;
}
return `npm:${upgrade.packageName}@${value}`;
}