Skip to content

Commit af8fee5

Browse files
authored
chore: fix the oxlint violations in the release changelog scripts (#335)
1 parent 9781e3c commit af8fee5

4 files changed

Lines changed: 16 additions & 32 deletions

File tree

‎.github/scripts/clean-release-changelog.mts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export function splitReleaseSectionIntoChunks(
153153
const entries: CategorizedEntry[] = [];
154154
let category: string | undefined;
155155
let currentEntry: string[] = [];
156-
const endEntry = () => {
156+
const endEntry = (): void => {
157157
if (category && currentEntry.length > 0) {
158158
entries.push({ category, text: currentEntry.join('\n').trimEnd() });
159159
}
@@ -179,7 +179,7 @@ export function splitReleaseSectionIntoChunks(
179179
let chunkEntries = new Map<string, string[]>();
180180
let chunkEntryCount = 0;
181181
let chunkPrNumbers: string[] = [];
182-
const addChunk = () => {
182+
const addChunk = (): void => {
183183
if (chunkEntryCount === 0) {
184184
return;
185185
}
@@ -291,7 +291,7 @@ function getCategorizedBlocks(
291291
const blocks = new Map<string, string[]>();
292292
let category: string | undefined;
293293
let categoryEntries: string[] = [];
294-
const addCategory = () => {
294+
const addCategory = (): void => {
295295
if (!category) {
296296
return;
297297
}
@@ -382,7 +382,7 @@ export function validateReplacement(
382382
const categoryNames = new Set<string>();
383383
let category: string | undefined;
384384
let categoryEntryCount = 0;
385-
const endCategory = () => {
385+
const endCategory = (): void => {
386386
if (category && categoryEntryCount === 0) {
387387
throw new Error(`Category ${category} must not be empty`);
388388
}
@@ -525,7 +525,7 @@ export async function requestGhApiWithRetry(
525525
request: GhApiRequest = executeGhApi,
526526
sleep?: (milliseconds: number) => Promise<void>,
527527
): Promise<string> {
528-
return await retry(async () => request(argumentsList), {
528+
return await retry(async () => await request(argumentsList), {
529529
delayMilliseconds: GH_API_RETRY_DELAY_MS,
530530
maxAttempts: GH_API_MAX_ATTEMPTS,
531531
onRetry: ({ attempt, delayMilliseconds }) => {
@@ -763,7 +763,7 @@ export async function requestCleanRoomRewrite({
763763
],
764764
};
765765

766-
return retry(
766+
return await retry(
767767
async () => {
768768
const controller = new AbortController();
769769
const timeout = setTimeout(() => controller.abort(), timeoutMs);
@@ -839,7 +839,7 @@ export async function requestValidatedRewrite(
839839
prNumbers: readonly string[],
840840
maxAttempts = MAX_VALIDATION_ATTEMPTS,
841841
): Promise<string> {
842-
return retry(
842+
return await retry(
843843
async () => {
844844
const section = await requestCleanRoomRewrite(options);
845845
try {

‎.github/scripts/update-release-changelog-baseline.mts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import {
55
} from './release-section.mts';
66
import {
77
compareSemver,
8-
type ReleaseBranch,
98
selectHighestLowerVersion,
109
} from './release-version-utils.mts';
10+
import type { ReleaseBranch } from './release-version-utils.mts';
1111

1212
const RELEASE_LINK_REFERENCE = /^\[(\d+\.\d+\.\d+)\]: /u;
1313

‎.github/scripts/update-release-changelog.mts‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ import {
2828
restoreGeneratedCategories,
2929
splitLines,
3030
} from './release-section.mts';
31+
import type { ReleaseBranch } from './release-version-utils.mts';
3132
import { compareSemver, parseReleaseBranch } from './release-version-utils.mts';
3233
import { getEnvironmentWithoutAiKey } from './shared/environment.mts';
3334
import { writeReport } from './shared/report.mts';
3435
import {
3536
removeNewerReleases,
3637
selectChangelogBaseline,
37-
type ChangelogBaseline,
3838
} from './update-release-changelog-baseline.mts';
39+
import type { ChangelogBaseline } from './update-release-changelog-baseline.mts';
3940

4041
type ProofreadingStatus = 'succeeded' | 'failed' | 'no-new-prs' | 'unchanged';
4142

@@ -373,7 +374,7 @@ function getStableVersions(): string[] {
373374
*
374375
* @returns The parsed release branches.
375376
*/
376-
function getReleaseBranches() {
377+
function getReleaseBranches(): ReleaseBranch[] {
377378
// strip=3 drops `refs/remotes/origin/`, leaving `release/X.Y.Z`.
378379
return capture('git', [
379380
'for-each-ref',
@@ -2066,12 +2067,12 @@ function main(): void {
20662067
);
20672068
}
20682069

2069-
const readChangelog = () => readFileSync('CHANGELOG.md', 'utf8');
2070-
const writeChangelog = (content: string) =>
2070+
const readChangelog = (): string => readFileSync('CHANGELOG.md', 'utf8');
2071+
const writeChangelog = (content: string): void =>
20712072
writeFileSync('CHANGELOG.md', content);
2072-
const readCurrentReleaseSection = () =>
2073+
const readCurrentReleaseSection = (): string =>
20732074
extractReleaseSection(readChangelog(), version).section;
2074-
const writeCurrentReleaseSection = (section: string) =>
2075+
const writeCurrentReleaseSection = (section: string): void =>
20752076
writeChangelog(replaceReleaseSection(readChangelog(), version, section));
20762077

20772078
const authorEmail =
@@ -2344,7 +2345,7 @@ function main(): void {
23442345
}
23452346
runChangelogValidation(proofreading, version);
23462347

2347-
const assertSourcesUnchanged = () => {
2348+
const assertSourcesUnchanged = (): void => {
23482349
try {
23492350
assertRemoteRefUnchanged({
23502351
ref: `origin/${releaseBranch}`,

‎oxlint-suppressions.json‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@
3737
},
3838
"node/no-sync": {
3939
"count": 4
40-
},
41-
"typescript/explicit-function-return-type": {
42-
"count": 4
43-
},
44-
"typescript/return-await": {
45-
"count": 3
4640
}
4741
},
4842
".github/scripts/create-flaky-test-report.mjs": {
@@ -278,23 +272,12 @@
278272
"count": 3
279273
}
280274
},
281-
".github/scripts/update-release-changelog-baseline.mts": {
282-
"import/consistent-type-specifier-style": {
283-
"count": 1
284-
}
285-
},
286275
".github/scripts/update-release-changelog.mts": {
287-
"import/consistent-type-specifier-style": {
288-
"count": 1
289-
},
290276
"node/no-process-env": {
291277
"count": 12
292278
},
293279
"node/no-sync": {
294280
"count": 17
295-
},
296-
"typescript/explicit-function-return-type": {
297-
"count": 6
298281
}
299282
},
300283
".github/scripts/update-release-sheet.mjs": {

0 commit comments

Comments
 (0)