Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"no-negated-condition": "error",
"no-template-curly-in-string": "error",
"curly": "error",
"radix": ["error", "as-needed"],
"radix": ["error"],
"import/extensions": ["error", "always", { "ignorePackages": true }],
"import/no-cycle": "error",
"import/default": "error",
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/docker/dockerhub-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class DockerHubCache {

if (earliestDate && latestDate) {
for (const [key, item] of Object.entries(this.cache.items)) {
const id = parseInt(key);
const id = parseInt(key, 10);

const itemDate = DateTime.fromISO(item.last_updated);

Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/go/releases-goproxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export class GoProxyDatasource extends Datasource {
const majorSuffixSeparator = isGopkgin ? '.' : '/';
const modParts = packageName.match(modRegex)?.groups;
const baseMod = modParts?.baseMod ?? /* v8 ignore next */ packageName;
const packageMajor = parseInt(modParts?.majorVersion ?? '0');
const packageMajor = parseInt(modParts?.majorVersion ?? '0', 10);

const result: ReleaseResult = { releases: [] };
for (let major = packageMajor; ; major += 1) {
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/datasource/maven/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ function mockGenericPackage(opts: MockOpts = {}) {
const [major, minor, patch] = latest
.replace('-SNAPSHOT', '')
.split('.')
.map((x) => parseInt(x))
.map((x) => parseInt(x, 10))
.map((x) => (x < 10 ? `0${x}` : `${x}`));
scope
.get(
`/${packagePath}/${latest}/${artifact}-${latest.replace(
'-SNAPSHOT',
'',
)}-20200101.${major}${minor}${patch}-${parseInt(patch)}.pom`,
)}-20200101.${major}${minor}${patch}-${parseInt(patch, 10)}.pom`,
)
.reply(200, pom);
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/nuget/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function parseRegistryUrl(registryUrl: string): ParsedRegistryUrl {
if (protocolVersionMatch) {
const { protocol } = protocolVersionMatch;
parsedUrl.hash = '';
protocolVersion = Number.parseInt(protocol);
protocolVersion = Number.parseInt(protocol, 10);
} else if (parsedUrl.pathname.endsWith('.json')) {
protocolVersion = 3;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/npm/extract/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function getYarnLock(filePath: string): Promise<LockFile> {
for (const [key, val] of Object.entries(parsed)) {
if (key === '__metadata') {
// yarn 2
lockfileVersion = parseInt(val.cacheKey);
lockfileVersion = parseInt(val.cacheKey, 10);
logger.once.debug(
`yarn.lock ${filePath} has __metadata.cacheKey=${lockfileVersion}`,
);
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/platform/bitbucket-server/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,5 @@ export function parseModifier(value: string): number | null {
if (!match) {
return null;
}
return parseInt(match[1] ?? '1');
return parseInt(match[1] ?? '1', 10);
}
4 changes: 2 additions & 2 deletions lib/modules/platform/codecommit/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export async function getPrList(): Promise<CodeCommitPr[]> {
prInfo.pullRequestStatus === PullRequestStatusEnum.OPEN
? 'open'
: 'closed',
number: Number.parseInt(prId),
number: Number.parseInt(prId, 10),
title: prInfo.title!,
body: prInfo.description!,
createdAt: prInfo.creationDate?.toISOString(),
Expand Down Expand Up @@ -394,7 +394,7 @@ export async function createPr({
}

return {
number: Number.parseInt(prCreateRes.pullRequest.pullRequestId),
number: Number.parseInt(prCreateRes.pullRequest.pullRequestId, 10),
state: 'open',
title: prCreateRes.pullRequest.title,
sourceBranch,
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/platform/gerrit/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export function mapBranchStatusToLabel(
state: BranchStatus | 'UNKNOWN', // suppress default path code removal
label: GerritLabelTypeInfo,
): number {
const numbers = Object.keys(label.values).map((x) => parseInt(x));
const numbers = Object.keys(label.values).map((x) => parseInt(x, 10));
switch (state) {
case 'green':
return Math.max(...numbers);
Expand Down
6 changes: 3 additions & 3 deletions lib/modules/platform/scm-manager/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe('modules/platform/scm-manager/index', () => {
sourceBranch: pullRequest.source,
createdAt: pullRequest.creationDate,
labels: pullRequest.labels,
number: parseInt(pullRequest.id),
number: parseInt(pullRequest.id, 10),
state: pullRequest.status,
targetBranch: pullRequest.target,
title: pullRequest.title,
Expand Down Expand Up @@ -375,7 +375,7 @@ describe('modules/platform/scm-manager/index', () => {
},
});

expect(await scmPlatform.getPr(parseInt(pullRequest.id))).toEqual(
expect(await scmPlatform.getPr(parseInt(pullRequest.id, 10))).toEqual(
renovatePr,
);
});
Expand All @@ -399,7 +399,7 @@ describe('modules/platform/scm-manager/index', () => {
.get(`/pull-requests/${repo.namespace}/${repo.name}/${pullRequest.id}`)
.reply(200, pullRequest);

expect(await scmPlatform.getPr(parseInt(pullRequest.id))).toEqual(
expect(await scmPlatform.getPr(parseInt(pullRequest.id, 10))).toEqual(
renovatePr,
);
});
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/platform/scm-manager/mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function mapPrFromScmToRenovate(pr: PullRequest): Pr {
closedAt: pr.closeDate ?? undefined,
hasAssignees: !!pr.reviewer?.length,
labels: pr.labels,
number: parseInt(pr.id),
number: parseInt(pr.id, 10),
reviewers: pr.reviewer?.map((review) => review.displayName) ?? [],
state: pr.status,
title: pr.title,
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/versioning/azure-rest-api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AzureRestApiVersioningApi extends GenericVersioningApi {
const { year, month, day, prerelease } = matchGroups;

return {
release: [parseInt(`${year}${month}${day}`), 0, 0],
release: [parseInt(`${year}${month}${day}`, 10), 0, 0],
prerelease,
};
}
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/versioning/bazel-module/bzlmod-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class Identifier {
this.asString = value;
if (Identifier.digitsOnlyMatcher.test(value)) {
this.isDigitsOnly = true;
this.asNumber = parseInt(value);
this.asNumber = parseInt(value, 10);
} else {
this.isDigitsOnly = false;
this.asNumber = 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/versioning/conan/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function makeVersion(
const prerelease = semver.prerelease(version, options);

if (prerelease && !options.includePrerelease) {
if (!Number.isNaN(parseInt(prerelease.toString()[0]))) {
if (!Number.isNaN(parseInt(prerelease.toString()[0], 10))) {
const stringVersion = `${splitVersion[0]}.${splitVersion[1]}.${splitVersion[2]}`;
return semver.valid(stringVersion, options);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/versioning/deb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ class DebVersioningApi extends GenericVersioningApi {
return null;
}
const release = [...remainingVersion.matchAll(numericPattern)].map((m) =>
parseInt(m[0]),
parseInt(m[0], 10),
);
return {
epoch: parseInt(epochStr),
epoch: parseInt(epochStr, 10),
upstreamVersion,
debianRevision,
release,
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/versioning/generic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('modules/versioning/generic', () => {
}
const { major, minor, patch, prerelease } = matchGroups;
return {
release: [major, minor, patch].map((x) => parseInt(x)),
release: [major, minor, patch].map((x) => parseInt(x, 10)),
prerelease,
};
}
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/versioning/glasskube/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class GlasskubeVersioningApi extends GenericVersioningApi {
const build = parsedVersion.build.at(0);
if (build) {
try {
result.release.push(parseInt(build));
result.release.push(parseInt(build, 10));
} catch {
/* noop */
}
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/versioning/gradle/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function tokenize(versionStr: string): Token[] | null {
if (regEx(/^\d+$/).test(val)) {
result.push({
type: TokenType.Number,
val: parseInt(val),
val: parseInt(val, 10),
});
} else {
result.push({
Expand Down
20 changes: 10 additions & 10 deletions lib/modules/versioning/hermit/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ export class HermitVersioning extends RegExpVersioningApi {
compatibility,
} = groups;
const release = [
Number.parseInt(major),
typeof minor === 'undefined' ? 0 : Number.parseInt(minor),
typeof patch === 'undefined' ? 0 : Number.parseInt(patch),
typeof supplement === 'undefined' ? 0 : Number.parseInt(supplement),
Number.parseInt(major, 10),
typeof minor === 'undefined' ? 0 : Number.parseInt(minor, 10),
typeof patch === 'undefined' ? 0 : Number.parseInt(patch, 10),
typeof supplement === 'undefined' ? 0 : Number.parseInt(supplement, 10),
];

if (build) {
release.push(Number.parseInt(build));
release.push(Number.parseInt(build, 10));
}

return {
Expand Down Expand Up @@ -82,20 +82,20 @@ export class HermitVersioning extends RegExpVersioningApi {
const release = [];

if (major) {
release.push(Number.parseInt(major));
release.push(Number.parseInt(major, 10));
}

if (minor) {
release.push(Number.parseInt(minor));
release.push(Number.parseInt(minor, 10));
}
if (patch) {
release.push(Number.parseInt(patch));
release.push(Number.parseInt(patch, 10));
}
if (supplement) {
release.push(Number.parseInt(supplement));
release.push(Number.parseInt(supplement, 10));
}
if (build) {
release.push(Number.parseInt(build));
release.push(Number.parseInt(build, 10));
}

return {
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/versioning/maven/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function iterateTokens(versionStr: string, cb: (token: Token) => void): void {
cb({
prefix: currentPrefix,
type: TYPE_NUMBER,
val: parseInt(val),
val: parseInt(val, 10),
isTransition: transition,
});
} else {
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/versioning/nixpkgs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ export class NixPkgsVersioning extends RegExpVersioningApi {
const release = [];

if (major) {
release.push(Number.parseInt(major));
release.push(Number.parseInt(major, 10));
}

if (minor) {
release.push(Number.parseInt(minor));
release.push(Number.parseInt(minor, 10));
}

const compatibility = isNonEmptyStringAndNotWhitespace(suffix)
Expand Down
18 changes: 9 additions & 9 deletions lib/modules/versioning/nuget/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ export function parseVersion(input: string): NugetVersion | null {

const res: NugetVersion = {
type: 'nuget-version',
major: Number.parseInt(major),
major: Number.parseInt(major, 10),
};

if (minor) {
res.minor = Number.parseInt(minor);
res.minor = Number.parseInt(minor, 10);
}

if (patch) {
res.patch = Number.parseInt(patch);
res.patch = Number.parseInt(patch, 10);
}

if (revision) {
res.revision = Number.parseInt(revision);
res.revision = Number.parseInt(revision, 10);
}

if (prerelease) {
Expand All @@ -58,7 +58,7 @@ const floatingRangeRegex = regEx(

function parseFloatingComponent(input: string): number {
const [int] = input.split('*');
return int ? 10 * Number.parseInt(int) : 0;
return int ? 10 * Number.parseInt(int, 10) : 0;
}

export function parseFloatingRange(input: string): NugetFloatingRange | null {
Expand Down Expand Up @@ -96,7 +96,7 @@ export function parseFloatingRange(input: string): NugetFloatingRange | null {
};
}

const majorNum = Number.parseInt(major);
const majorNum = Number.parseInt(major, 10);
if (!Number.isNaN(majorNum)) {
res = { ...res, major: majorNum };
}
Expand All @@ -109,7 +109,7 @@ export function parseFloatingRange(input: string): NugetFloatingRange | null {
};
}

const minorNum = Number.parseInt(minor);
const minorNum = Number.parseInt(minor, 10);
if (!Number.isNaN(minorNum)) {
res = { ...res, minor: minorNum };
}
Expand All @@ -122,7 +122,7 @@ export function parseFloatingRange(input: string): NugetFloatingRange | null {
};
}

const patchNum = Number.parseInt(patch);
const patchNum = Number.parseInt(patch, 10);
if (!Number.isNaN(patchNum)) {
res = { ...res, patch: patchNum };
}
Expand All @@ -135,7 +135,7 @@ export function parseFloatingRange(input: string): NugetFloatingRange | null {
};
}

const revisionNum = Number.parseInt(revision);
const revisionNum = Number.parseInt(revision, 10);
if (!Number.isNaN(revisionNum)) {
res = { ...res, revision: revisionNum };
}
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/versioning/nuget/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function ensureNumber(input: string): number | null {
return null;
}

return Number.parseInt(input);
return Number.parseInt(input, 10);
}

function comparePrereleases(x: string, y: string): number {
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/versioning/pep440/range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ function trimTrailingZeros(numbers: number[]): number[] {
function divideCompatibleReleaseRange(currentRange: Range): Range[] {
const currentVersionUpperBound = currentRange.version
.split('.')
.map((num) => parseInt(num));
.map((num) => parseInt(num, 10));
if (currentVersionUpperBound.length > 1) {
currentVersionUpperBound.splice(-1);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/versioning/perl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class PerlVersioningApi extends GenericVersioningApi {
while (component.length < 3) {
component += '0';
}
return Number.parseInt(component);
return Number.parseInt(component, 10);
}) ?? /* istanbul ignore next */ [];
const release = [Number.parseInt(intPart), ...decimalComponents];
const release = [Number.parseInt(intPart, 10), ...decimalComponents];
return { release, prerelease };
}

Expand Down
2 changes: 1 addition & 1 deletion lib/modules/versioning/poetry/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function poetry2semver(
// trim leading zeros from valid numbers
const releaseParts = matchGroups.release
.split('.')
.map((segment) => parseInt(segment));
.map((segment) => parseInt(segment, 10));
while (padRelease && releaseParts.length < 3) {
releaseParts.push(0);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/versioning/pvp/util.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Parts } from './types.ts';

export function extractAllParts(version: string): number[] | null {
const parts = version.split('.').map((x) => parseInt(x));
const parts = version.split('.').map((x) => parseInt(x, 10));
const ret: number[] = [];
for (const l of parts) {
if (l < 0 || !isFinite(l)) {
Expand Down
Loading
Loading