From cb1d8bda2a57d2e878204bdc1296e9307813155f Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Tue, 17 Nov 2026 14:07:55 +0100 Subject: [PATCH] chore: fix the oxlint violations in the release changelog scripts --- .github/scripts/clean-release-changelog.mts | 14 +++++++------- .../update-release-changelog-baseline.mts | 2 +- .github/scripts/update-release-changelog.mts | 15 ++++++++------- oxlint-suppressions.json | 17 ----------------- 4 files changed, 16 insertions(+), 32 deletions(-) diff --git a/.github/scripts/clean-release-changelog.mts b/.github/scripts/clean-release-changelog.mts index 1f3e3f81..1d8e3828 100644 --- a/.github/scripts/clean-release-changelog.mts +++ b/.github/scripts/clean-release-changelog.mts @@ -153,7 +153,7 @@ export function splitReleaseSectionIntoChunks( const entries: CategorizedEntry[] = []; let category: string | undefined; let currentEntry: string[] = []; - const endEntry = () => { + const endEntry = (): void => { if (category && currentEntry.length > 0) { entries.push({ category, text: currentEntry.join('\n').trimEnd() }); } @@ -179,7 +179,7 @@ export function splitReleaseSectionIntoChunks( let chunkEntries = new Map(); let chunkEntryCount = 0; let chunkPrNumbers: string[] = []; - const addChunk = () => { + const addChunk = (): void => { if (chunkEntryCount === 0) { return; } @@ -291,7 +291,7 @@ function getCategorizedBlocks( const blocks = new Map(); let category: string | undefined; let categoryEntries: string[] = []; - const addCategory = () => { + const addCategory = (): void => { if (!category) { return; } @@ -382,7 +382,7 @@ export function validateReplacement( const categoryNames = new Set(); let category: string | undefined; let categoryEntryCount = 0; - const endCategory = () => { + const endCategory = (): void => { if (category && categoryEntryCount === 0) { throw new Error(`Category ${category} must not be empty`); } @@ -525,7 +525,7 @@ export async function requestGhApiWithRetry( request: GhApiRequest = executeGhApi, sleep?: (milliseconds: number) => Promise, ): Promise { - return await retry(async () => request(argumentsList), { + return await retry(async () => await request(argumentsList), { delayMilliseconds: GH_API_RETRY_DELAY_MS, maxAttempts: GH_API_MAX_ATTEMPTS, onRetry: ({ attempt, delayMilliseconds }) => { @@ -763,7 +763,7 @@ export async function requestCleanRoomRewrite({ ], }; - return retry( + return await retry( async () => { const controller = new AbortController(); const timeout = setTimeout(() => controller.abort(), timeoutMs); @@ -839,7 +839,7 @@ export async function requestValidatedRewrite( prNumbers: readonly string[], maxAttempts = MAX_VALIDATION_ATTEMPTS, ): Promise { - return retry( + return await retry( async () => { const section = await requestCleanRoomRewrite(options); try { diff --git a/.github/scripts/update-release-changelog-baseline.mts b/.github/scripts/update-release-changelog-baseline.mts index a34a7366..e1213c82 100644 --- a/.github/scripts/update-release-changelog-baseline.mts +++ b/.github/scripts/update-release-changelog-baseline.mts @@ -5,9 +5,9 @@ import { } from './release-section.mts'; import { compareSemver, - type ReleaseBranch, selectHighestLowerVersion, } from './release-version-utils.mts'; +import type { ReleaseBranch } from './release-version-utils.mts'; const RELEASE_LINK_REFERENCE = /^\[(\d+\.\d+\.\d+)\]: /u; diff --git a/.github/scripts/update-release-changelog.mts b/.github/scripts/update-release-changelog.mts index 9defff80..148c852d 100644 --- a/.github/scripts/update-release-changelog.mts +++ b/.github/scripts/update-release-changelog.mts @@ -28,14 +28,15 @@ import { restoreGeneratedCategories, splitLines, } from './release-section.mts'; +import type { ReleaseBranch } from './release-version-utils.mts'; import { compareSemver, parseReleaseBranch } from './release-version-utils.mts'; import { getEnvironmentWithoutAiKey } from './shared/environment.mts'; import { writeReport } from './shared/report.mts'; import { removeNewerReleases, selectChangelogBaseline, - type ChangelogBaseline, } from './update-release-changelog-baseline.mts'; +import type { ChangelogBaseline } from './update-release-changelog-baseline.mts'; type ProofreadingStatus = 'succeeded' | 'failed' | 'no-new-prs' | 'unchanged'; @@ -373,7 +374,7 @@ function getStableVersions(): string[] { * * @returns The parsed release branches. */ -function getReleaseBranches() { +function getReleaseBranches(): ReleaseBranch[] { // strip=3 drops `refs/remotes/origin/`, leaving `release/X.Y.Z`. return capture('git', [ 'for-each-ref', @@ -2066,12 +2067,12 @@ function main(): void { ); } - const readChangelog = () => readFileSync('CHANGELOG.md', 'utf8'); - const writeChangelog = (content: string) => + const readChangelog = (): string => readFileSync('CHANGELOG.md', 'utf8'); + const writeChangelog = (content: string): void => writeFileSync('CHANGELOG.md', content); - const readCurrentReleaseSection = () => + const readCurrentReleaseSection = (): string => extractReleaseSection(readChangelog(), version).section; - const writeCurrentReleaseSection = (section: string) => + const writeCurrentReleaseSection = (section: string): void => writeChangelog(replaceReleaseSection(readChangelog(), version, section)); const authorEmail = @@ -2344,7 +2345,7 @@ function main(): void { } runChangelogValidation(proofreading, version); - const assertSourcesUnchanged = () => { + const assertSourcesUnchanged = (): void => { try { assertRemoteRefUnchanged({ ref: `origin/${releaseBranch}`, diff --git a/oxlint-suppressions.json b/oxlint-suppressions.json index 61224d9f..183bc9b9 100644 --- a/oxlint-suppressions.json +++ b/oxlint-suppressions.json @@ -37,12 +37,6 @@ }, "node/no-sync": { "count": 4 - }, - "typescript/explicit-function-return-type": { - "count": 4 - }, - "typescript/return-await": { - "count": 3 } }, ".github/scripts/create-flaky-test-report.mjs": { @@ -278,23 +272,12 @@ "count": 3 } }, - ".github/scripts/update-release-changelog-baseline.mts": { - "import/consistent-type-specifier-style": { - "count": 1 - } - }, ".github/scripts/update-release-changelog.mts": { - "import/consistent-type-specifier-style": { - "count": 1 - }, "node/no-process-env": { "count": 12 }, "node/no-sync": { "count": 17 - }, - "typescript/explicit-function-return-type": { - "count": 6 } }, ".github/scripts/update-release-sheet.mjs": {