diff --git a/.github/actions/javascript/authorChecklist/index.js b/.github/actions/javascript/authorChecklist/index.js index 6f9905312e7b..b4cdb8cf952b 100644 --- a/.github/actions/javascript/authorChecklist/index.js +++ b/.github/actions/javascript/authorChecklist/index.js @@ -15890,43 +15890,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/awaitStagingDeploys/index.js b/.github/actions/javascript/awaitStagingDeploys/index.js index cf48135dd221..24ea43eb5ad2 100644 --- a/.github/actions/javascript/awaitStagingDeploys/index.js +++ b/.github/actions/javascript/awaitStagingDeploys/index.js @@ -12694,43 +12694,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/checkAndroidStatus/index.js b/.github/actions/javascript/checkAndroidStatus/index.js index 15042eba0ba9..c0b1db742852 100644 --- a/.github/actions/javascript/checkAndroidStatus/index.js +++ b/.github/actions/javascript/checkAndroidStatus/index.js @@ -737437,43 +737437,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/checkDeployBlockers/index.js b/.github/actions/javascript/checkDeployBlockers/index.js index c89841b07bc9..cdfb64a11deb 100644 --- a/.github/actions/javascript/checkDeployBlockers/index.js +++ b/.github/actions/javascript/checkDeployBlockers/index.js @@ -11961,43 +11961,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/checkSVGCompression/index.js b/.github/actions/javascript/checkSVGCompression/index.js index 33f9c06c00f4..bf86e0459980 100644 --- a/.github/actions/javascript/checkSVGCompression/index.js +++ b/.github/actions/javascript/checkSVGCompression/index.js @@ -20486,43 +20486,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; @@ -21042,7 +21042,9 @@ function validateSvgFiles(filePaths) { } if (errors.length) { console.error('Validation errors:'); - errors.forEach((error) => console.error(` ${error}`)); + for (const error of errors) { + console.error(` ${error}`); + } throw new Error('SVG file validation failed'); } return validFiles; @@ -21073,19 +21075,19 @@ function logIgnoredFiles(ignoredFiles) { return; } console.log('\nFiles skipped (ignore-compression):'); - ignoredFiles.forEach((filePath) => { + for (const filePath of ignoredFiles) { console.log(`${filePath}: ⏭️ Skipped`); - }); + } } function logSummary(summary) { const { totalFiles, totalCompressedFilesLength, totalOriginalSize, totalCompressedSize, totalSavings, totalSavingsPercent, results, ignoredFiles } = summary; logIgnoredFiles(ignoredFiles); if (totalCompressedFilesLength) { console.log('\nFiles compressed:'); - results.forEach((result) => { + for (const result of results) { const { compressedSize, originalSize, savings, savingsPercent, filePath } = result; if (!result.savings) { - return; + continue; } const prefix = `${filePath}: ✅`; console.log(getSummarySavingString({ @@ -21095,7 +21097,7 @@ function logSummary(summary) { savings, savingsPercent, })); - }); + } const ignoreFilesLength = ignoredFiles.length; console.log(`\nFiles processed: ${totalFiles}`); console.log(`Files already properly compressed: ${totalFiles - ignoreFilesLength - totalCompressedFilesLength}`); @@ -21116,10 +21118,10 @@ function logSummary(summary) { function logSummaryCheck(summary) { const { totalFiles, totalCompressedFilesLength, results, ignoredFiles } = summary; console.log(''); - results.forEach((result) => { + for (const result of results) { const { filePath, savings } = result; console.log(`${filePath}: ${savings > 0 ? 'Not properly compressed ❌' : 'Compressed ✅'}`); - }); + } logIgnoredFiles(ignoredFiles); console.log(`\nFiles processed: ${totalFiles}`); console.log(`Files ignored: ${ignoredFiles.length}`); diff --git a/.github/actions/javascript/createOrUpdateStagingDeploy/index.js b/.github/actions/javascript/createOrUpdateStagingDeploy/index.js index 720fbd5dccd8..4b9cf8bf1f4a 100644 --- a/.github/actions/javascript/createOrUpdateStagingDeploy/index.js +++ b/.github/actions/javascript/createOrUpdateStagingDeploy/index.js @@ -11921,25 +11921,25 @@ function getPreviousExistingTag(tag, level) { */ function getValidMergedPRs(commits) { const mergedPRs = new Set(); - commits.forEach((commit) => { + for (const commit of commits) { const author = commit.authorName; if (author === CONST_1.default.OS_BOTIFY) { - return; + continue; } // Retrieve the PR number from the commit subject, const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-(staging|production))/); if (!Array.isArray(match) || match.length < 2) { - return; + continue; } const pr = Number.parseInt(match[1], 10); if (mergedPRs.has(pr)) { // If a PR shows up in the log twice, that means that the PR was deployed in the previous checklist. // That also means that we don't want to include it in the current checklist, so we remove it now. mergedPRs.delete(pr); - return; + continue; } mergedPRs.add(pr); - }); + } return Array.from(mergedPRs); } /** @@ -12248,43 +12248,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/formatCodeCovComment/index.js b/.github/actions/javascript/formatCodeCovComment/index.js index 3341eb6f5d88..311e09971b26 100644 --- a/.github/actions/javascript/formatCodeCovComment/index.js +++ b/.github/actions/javascript/formatCodeCovComment/index.js @@ -12148,43 +12148,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/generateHelpPreviewComment/generateHelpPreviewComment.ts b/.github/actions/javascript/generateHelpPreviewComment/generateHelpPreviewComment.ts index cbb119fa19a4..4b1575384e1b 100644 --- a/.github/actions/javascript/generateHelpPreviewComment/generateHelpPreviewComment.ts +++ b/.github/actions/javascript/generateHelpPreviewComment/generateHelpPreviewComment.ts @@ -27,20 +27,20 @@ async function getUpdatedDocRoutes(octokit: OctokitClient, owner: string, repo: const routes = new Set(); - files.forEach((file) => { + for (const file of files) { const filename = file.filename ?? ''; const status = file.status ?? ''; if (!INCLUDED_STATUSES.has(status)) { - return; + continue; } if (!filename.startsWith(DOCS_DIRECTORY_PREFIX) || !filename.endsWith(MARKDOWN_EXTENSION)) { - return; + continue; } routes.add(toRoutePath(filename)); - }); + } return [...routes].sort((a, b) => a.localeCompare(b)); } @@ -72,7 +72,9 @@ async function run(): Promise { core.setOutput('BODY', body); core.startGroup('Updated ExpensifyHelp routes'); - routes.forEach((route) => console.log(route)); + for (const route of routes) { + console.log(route); + } core.endGroup(); console.log(`Generated preview comment with ${routes.length} updated article(s)`); diff --git a/.github/actions/javascript/getArtifactInfo/index.js b/.github/actions/javascript/getArtifactInfo/index.js index 602f76d58fd8..fe555326687a 100644 --- a/.github/actions/javascript/getArtifactInfo/index.js +++ b/.github/actions/javascript/getArtifactInfo/index.js @@ -11922,43 +11922,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/getDeployPullRequestList/index.js b/.github/actions/javascript/getDeployPullRequestList/index.js index d8cc6b258411..cb621adf1f18 100644 --- a/.github/actions/javascript/getDeployPullRequestList/index.js +++ b/.github/actions/javascript/getDeployPullRequestList/index.js @@ -11940,25 +11940,25 @@ function getPreviousExistingTag(tag, level) { */ function getValidMergedPRs(commits) { const mergedPRs = new Set(); - commits.forEach((commit) => { + for (const commit of commits) { const author = commit.authorName; if (author === CONST_1.default.OS_BOTIFY) { - return; + continue; } // Retrieve the PR number from the commit subject, const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-(staging|production))/); if (!Array.isArray(match) || match.length < 2) { - return; + continue; } const pr = Number.parseInt(match[1], 10); if (mergedPRs.has(pr)) { // If a PR shows up in the log twice, that means that the PR was deployed in the previous checklist. // That also means that we don't want to include it in the current checklist, so we remove it now. mergedPRs.delete(pr); - return; + continue; } mergedPRs.add(pr); - }); + } return Array.from(mergedPRs); } /** @@ -12267,43 +12267,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/getPreviousVersion/index.js b/.github/actions/javascript/getPreviousVersion/index.js index 8f6e8676d172..4d3928f692f8 100644 --- a/.github/actions/javascript/getPreviousVersion/index.js +++ b/.github/actions/javascript/getPreviousVersion/index.js @@ -11751,25 +11751,25 @@ function getPreviousExistingTag(tag, level) { */ function getValidMergedPRs(commits) { const mergedPRs = new Set(); - commits.forEach((commit) => { + for (const commit of commits) { const author = commit.authorName; if (author === CONST_1.default.OS_BOTIFY) { - return; + continue; } // Retrieve the PR number from the commit subject, const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-(staging|production))/); if (!Array.isArray(match) || match.length < 2) { - return; + continue; } const pr = Number.parseInt(match[1], 10); if (mergedPRs.has(pr)) { // If a PR shows up in the log twice, that means that the PR was deployed in the previous checklist. // That also means that we don't want to include it in the current checklist, so we remove it now. mergedPRs.delete(pr); - return; + continue; } mergedPRs.add(pr); - }); + } return Array.from(mergedPRs); } /** @@ -12078,43 +12078,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/getPullRequestDetails/index.js b/.github/actions/javascript/getPullRequestDetails/index.js index 3fbe0d9bdc05..93ecd6b74e3f 100644 --- a/.github/actions/javascript/getPullRequestDetails/index.js +++ b/.github/actions/javascript/getPullRequestDetails/index.js @@ -12051,43 +12051,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/getPullRequestIncrementalChanges/index.js b/.github/actions/javascript/getPullRequestIncrementalChanges/index.js index 3844a9e41673..a2bf8794b803 100644 --- a/.github/actions/javascript/getPullRequestIncrementalChanges/index.js +++ b/.github/actions/javascript/getPullRequestIncrementalChanges/index.js @@ -12153,43 +12153,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/isStagingDeployLocked/index.js b/.github/actions/javascript/isStagingDeployLocked/index.js index 05f5c97c5711..89729c7f78f8 100644 --- a/.github/actions/javascript/isStagingDeployLocked/index.js +++ b/.github/actions/javascript/isStagingDeployLocked/index.js @@ -11922,43 +11922,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/markPullRequestsAsDeployed/index.js b/.github/actions/javascript/markPullRequestsAsDeployed/index.js index 8d0acf0697a7..9921cd1ec47a 100644 --- a/.github/actions/javascript/markPullRequestsAsDeployed/index.js +++ b/.github/actions/javascript/markPullRequestsAsDeployed/index.js @@ -13375,43 +13375,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/postTestBuildComment/index.js b/.github/actions/javascript/postTestBuildComment/index.js index 7bd635262af6..2dcc10f82a8f 100644 --- a/.github/actions/javascript/postTestBuildComment/index.js +++ b/.github/actions/javascript/postTestBuildComment/index.js @@ -12052,43 +12052,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/proposalPoliceComment/index.js b/.github/actions/javascript/proposalPoliceComment/index.js index 00ba48ef3ac4..935e6c5fbdd0 100644 --- a/.github/actions/javascript/proposalPoliceComment/index.js +++ b/.github/actions/javascript/proposalPoliceComment/index.js @@ -12191,43 +12191,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/reopenIssueWithComment/index.js b/.github/actions/javascript/reopenIssueWithComment/index.js index 7e47116033b2..2bdf9f600987 100644 --- a/.github/actions/javascript/reopenIssueWithComment/index.js +++ b/.github/actions/javascript/reopenIssueWithComment/index.js @@ -11932,43 +11932,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/reviewerChecklist/index.js b/.github/actions/javascript/reviewerChecklist/index.js index d7a93db68979..f8081dff571c 100644 --- a/.github/actions/javascript/reviewerChecklist/index.js +++ b/.github/actions/javascript/reviewerChecklist/index.js @@ -12024,43 +12024,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/actions/javascript/verifySignedCommits/index.js b/.github/actions/javascript/verifySignedCommits/index.js index e46c499e3ea7..f9c0ad69f4b8 100644 --- a/.github/actions/javascript/verifySignedCommits/index.js +++ b/.github/actions/javascript/verifySignedCommits/index.js @@ -11964,43 +11964,43 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Internal QA PR list if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } issueBody += '**Deployer verifications:**'; diff --git a/.github/libs/GitUtils.ts b/.github/libs/GitUtils.ts index d48f423762dd..441e97a17abe 100644 --- a/.github/libs/GitUtils.ts +++ b/.github/libs/GitUtils.ts @@ -79,16 +79,16 @@ function getPreviousExistingTag(tag: string, level: SemverLevel) { */ function getValidMergedPRs(commits: CommitType[]): number[] { const mergedPRs = new Set(); - commits.forEach((commit) => { + for (const commit of commits) { const author = commit.authorName; if (author === CONST.OS_BOTIFY) { - return; + continue; } // Retrieve the PR number from the commit subject, const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-(staging|production))/); if (!Array.isArray(match) || match.length < 2) { - return; + continue; } const pr = Number.parseInt(match[1], 10); @@ -96,11 +96,11 @@ function getValidMergedPRs(commits: CommitType[]): number[] { // If a PR shows up in the log twice, that means that the PR was deployed in the previous checklist. // That also means that we don't want to include it in the current checklist, so we remove it now. mergedPRs.delete(pr); - return; + continue; } mergedPRs.add(pr); - }); + } return Array.from(mergedPRs); } diff --git a/.github/libs/GithubUtils.ts b/.github/libs/GithubUtils.ts index 8acedc4229a0..5a47cbf6aa0c 100644 --- a/.github/libs/GithubUtils.ts +++ b/.github/libs/GithubUtils.ts @@ -360,20 +360,20 @@ class GithubUtils { // PR list if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; - sortedPRList.forEach((URL) => { + for (const URL of sortedPRList) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } // Mobile-Expensify PR list if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; - sortedPRListMobileExpensify.forEach((URL) => { + for (const URL of sortedPRListMobileExpensify) { issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; - }); + } issueBody += '\r\n\r\n'; } @@ -381,25 +381,25 @@ class GithubUtils { if (!isEmptyObject(internalQAPRMap)) { console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs); issueBody += '**Internal QA:**\r\n'; - Object.keys(internalQAPRMap).forEach((URL) => { + for (const URL of Object.keys(internalQAPRMap)) { const merger = internalQAPRMap[URL]; const mergerMention = `@${merger}`; issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `; issueBody += `${URL}`; issueBody += ` - ${mergerMention}`; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } // Deploy blockers if (deployBlockers.length > 0) { issueBody += '**Deploy Blockers:**\r\n'; - sortedDeployBlockers.forEach((URL) => { + for (const URL of sortedDeployBlockers) { issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] '; issueBody += URL; issueBody += '\r\n'; - }); + } issueBody += '\r\n\r\n'; } diff --git a/.github/scripts/createDocsRoutes.ts b/.github/scripts/createDocsRoutes.ts index dbdb203c1b95..cd118b974eec 100644 --- a/.github/scripts/createDocsRoutes.ts +++ b/.github/scripts/createDocsRoutes.ts @@ -109,14 +109,14 @@ function getOrderFromArticleFrontMatter(path: string): number | undefined { * @param routeHubs - The hubs insude docs/data/_routes.yml for a platform */ function createHubsWithArticles(hubs: string[], platformName: ValueOf, routeHubs: Hub[]) { - hubs.forEach((hub) => { + for (const hub of hubs) { // Iterate through each directory in articles - fs.readdirSync(`${docsDir}/articles/${platformName}/${hub}`).forEach((fileOrFolder) => { + for (const fileOrFolder of fs.readdirSync(`${docsDir}/articles/${platformName}/${hub}`)) { // If the directory content is a markdown file, then it is an article if (fileOrFolder.endsWith('.md')) { const articleObj = getArticleObj(fileOrFolder); pushOrCreateEntry(routeHubs, hub, 'articles', articleObj); - return; + continue; } // For readability, we will use the term section to refer to subfolders @@ -124,18 +124,18 @@ function createHubsWithArticles(hubs: string[], platformName: ValueOf { + for (const subArticle of fs.readdirSync(`${docsDir}/articles/${platformName}/${hub}/${section}`)) { const order = getOrderFromArticleFrontMatter(`${docsDir}/articles/${platformName}/${hub}/${section}/${subArticle}`); articles.push(getArticleObj(subArticle, order)); - }); + } pushOrCreateEntry(routeHubs, hub, 'sections', { href: section, title: toTitleCase(section.replaceAll('-', ' ')), articles, }); - }); - }); + } + } } function run() { diff --git a/__mocks__/react-native.ts b/__mocks__/react-native.ts index 292d4e9f1901..c3ac98fad922 100644 --- a/__mocks__/react-native.ts +++ b/__mocks__/react-native.ts @@ -63,7 +63,9 @@ jest.doMock('react-native', () => { }, emitCurrentTestState(state: ReactNative.AppStateStatus) { appState = state; - Object.entries(changeListeners).forEach(([, listener]) => listener(appState)); + for (const [, listener] of Object.entries(changeListeners)) { + listener(appState); + } }, addEventListener(type: ReactNative.AppStateEvent, listener: (state: ReactNative.AppStateStatus) => void) { if (type === 'change') { diff --git a/assets/emojis/index.ts b/assets/emojis/index.ts index a5d64aba2bb7..09fd839a7dcb 100644 --- a/assets/emojis/index.ts +++ b/assets/emojis/index.ts @@ -20,9 +20,9 @@ const emojiCodeTableWithSkinTones = emojis.reduce((prev, cur) => { newValue[cur.code] = cur; } if ('types' in cur && cur.types) { - cur.types.forEach((type) => { + for (const type of cur.types) { newValue[type] = cur; - }); + } } return newValue; }, {}); diff --git a/desktop/main.ts b/desktop/main.ts index 6c45cf208ef3..4fb3bfa24c0b 100644 --- a/desktop/main.ts +++ b/desktop/main.ts @@ -173,13 +173,13 @@ const EXPECTED_UPDATE_VERSION_FLAG = '--expected-update-version'; const APP_DOMAIN = __DEV__ ? `https://dev.new.expensify.com:${port}` : 'app://-'; let expectedUpdateVersion: string; -process.argv.forEach((arg) => { +for (const arg of process.argv) { if (!arg.startsWith(`${EXPECTED_UPDATE_VERSION_FLAG}=`)) { - return; + continue; } expectedUpdateVersion = arg.slice(`${EXPECTED_UPDATE_VERSION_FLAG}=`.length); -}); +} // Add the listeners and variables required to ensure that auto-updating // happens correctly. diff --git a/help/default.js b/help/default.js index 1c27ade6c9e1..744678cc0b8b 100644 --- a/help/default.js +++ b/help/default.js @@ -163,14 +163,14 @@ function selectPreviousResult() { } function updateSelectedResult() { - g_searchResultsArray.forEach((result, index) => { + for (const [index, result] of g_searchResultsArray.entries()) { if (index === g_currentSelectionIndex) { result.classList.add('highlight'); result.scrollIntoView({behavior: 'smooth', block: 'nearest'}); } else { result.classList.remove('highlight'); } - }); + } } function navigateToSelectedResult() { @@ -234,8 +234,8 @@ function performSearch(query) { if (results && results.length > 0) { g_searchResultsArray = []; - results.forEach((result) => { - result.result.forEach((docId) => { + for (const result of results) { + for (const docId of result.result) { const doc = g_index.store[docId]; if (doc && doc.content) { const searchTermIndex = doc.content.toLowerCase().indexOf(query); @@ -257,8 +257,8 @@ function performSearch(query) { updateSelectedResult(); } } - }); - }); + } + } g_searchResults.style.display = 'block'; g_searchResults.focus(); } else { diff --git a/jest/setup.ts b/jest/setup.ts index 696c018fcf6c..7240770ca366 100644 --- a/jest/setup.ts +++ b/jest/setup.ts @@ -157,27 +157,27 @@ jest.mock('../src/hooks/useLazyAsset.ts', () => ({ useMemoizedLazyIllustrations: jest.fn((names: readonly string[]) => { // Return a Record with all requested illustration names const mockIllustrations: Record = {}; - names.forEach((name) => { + for (const name of names) { mockIllustrations[name] = { src: `mock-${name}`, testID: `mock-illustration-${name}`, height: 20, width: 20, }; - }); + } return mockIllustrations; }), useMemoizedLazyExpensifyIcons: jest.fn((names: readonly string[]) => { // Return a Record with all requested icon names const mockIcons: Record = {}; - names.forEach((name) => { + for (const name of names) { mockIcons[name] = { src: `mock-${name}`, testID: `mock-expensify-icon-${name}`, height: 20, width: 20, }; - }); + } return mockIcons; }), default: jest.fn(() => { @@ -228,15 +228,15 @@ jest.mock('@libs/prepareRequestPayload/index.native.ts', () => ({ default: jest.fn((command: string, data: Record) => { const formData = new FormData(); - Object.keys(data).forEach((key) => { + for (const key of Object.keys(data)) { const value = data[key]; if (value === undefined) { - return; + continue; } formData.append(key, value as string | Blob); - }); + } return Promise.resolve(formData); }), diff --git a/jest/setupMockImages.ts b/jest/setupMockImages.ts index 7f9d50dab797..a02ef68088f3 100644 --- a/jest/setupMockImages.ts +++ b/jest/setupMockImages.ts @@ -4,11 +4,11 @@ import path from 'path'; function mockImages(imagePath: string) { const imageFilenames = fs.readdirSync(path.resolve(__dirname, `../assets/${imagePath}/`)); // eslint-disable-next-line rulesdir/prefer-early-return - imageFilenames.forEach((fileName) => { + for (const fileName of imageFilenames) { if (/\.svg/.test(fileName)) { jest.mock(`../assets/${imagePath}/${fileName}`, () => () => ''); } - }); + } } // We are mocking all images so that Icons and other assets cannot break tests. In the testing environment, importing things like .svg diff --git a/scripts/checkLazyLoading.ts b/scripts/checkLazyLoading.ts index 42f8f5c42113..7c8427e6dcd4 100644 --- a/scripts/checkLazyLoading.ts +++ b/scripts/checkLazyLoading.ts @@ -58,7 +58,7 @@ function checkFile(filePath: string): Violation[] { const content = fs.readFileSync(filePath, 'utf-8'); const lines = content.split('\n'); - lines.forEach((line, index) => { + for (const [index, line] of lines.entries()) { const lineNumber = index + 1; for (const check of IMPORT_CHECKS) { @@ -72,7 +72,7 @@ function checkFile(filePath: string): Violation[] { }); } } - }); + } } catch (error) { console.warn(`⚠️ Warning: Could not read file ${filePath}: ${error instanceof Error ? error.message : String(error)}`); } @@ -103,10 +103,10 @@ async function main() { console.log(`Checking ${files.length} files for lazy loading violations...\n`); - files.forEach((file) => { + for (const file of files) { const violations = checkFile(file); allViolations.push(...violations); - }); + } if (allViolations.length === 0) { console.log('✅ No lazy loading violations found! All icons and illustrations are using lazy loading.'); @@ -115,21 +115,21 @@ async function main() { // Group violations by file const violationsByFile = new Map(); - allViolations.forEach((violation) => { + for (const violation of allViolations) { const existing = violationsByFile.get(violation.file) ?? []; existing.push(violation); violationsByFile.set(violation.file, existing); - }); + } - violationsByFile.forEach((violations, file) => { + for (const [file, violations] of violationsByFile.entries()) { console.error(`\n📄 ${file}`); - violations.forEach((violation) => { + for (const violation of violations) { const iconType = violation.type === 'illustration' ? 'Illustration' : 'Expensify Icon'; console.error(` Line ${violation.line}: ${iconType} import detected`); console.error(` ❌ ${violation.content}`); console.error(` ✅ ${violation.suggestedFix}`); - }); - }); + } + } console.error(`\n❌ Found ${allViolations.length} lazy loading violation(s) in ${violationsByFile.size} file(s):\n`); console.error(`\n\n💡 For migration help, see: docs/LAZY_ICONS_AND_ILLUSTRATIONS.md`); diff --git a/scripts/compressSvg.ts b/scripts/compressSvg.ts index 0ff2d80dd3c5..a74f69fbda10 100644 --- a/scripts/compressSvg.ts +++ b/scripts/compressSvg.ts @@ -180,7 +180,9 @@ function validateSvgFiles(filePaths: string[]): string[] { if (errors.length) { console.error('Validation errors:'); - errors.forEach((error) => console.error(` ${error}`)); + for (const error of errors) { + console.error(` ${error}`); + } throw new Error('SVG file validation failed'); } @@ -230,9 +232,9 @@ function logIgnoredFiles(ignoredFiles: string[]) { } console.log('\nFiles skipped (ignore-compression):'); - ignoredFiles.forEach((filePath) => { + for (const filePath of ignoredFiles) { console.log(`${filePath}: ⏭️ Skipped`); - }); + } } function logSummary(summary: CompressionSummary) { @@ -242,10 +244,10 @@ function logSummary(summary: CompressionSummary) { if (totalCompressedFilesLength) { console.log('\nFiles compressed:'); - results.forEach((result) => { + for (const result of results) { const {compressedSize, originalSize, savings, savingsPercent, filePath} = result; if (!result.savings) { - return; + continue; } const prefix = `${filePath}: ✅`; console.log( @@ -257,7 +259,7 @@ function logSummary(summary: CompressionSummary) { savingsPercent, }), ); - }); + } const ignoreFilesLength = ignoredFiles.length; @@ -283,10 +285,10 @@ function logSummaryCheck(summary: CompressionSummary) { const {totalFiles, totalCompressedFilesLength, results, ignoredFiles} = summary; console.log(''); - results.forEach((result) => { + for (const result of results) { const {filePath, savings} = result; console.log(`${filePath}: ${savings > 0 ? 'Not properly compressed ❌' : 'Compressed ✅'}`); - }); + } logIgnoredFiles(ignoredFiles); console.log(`\nFiles processed: ${totalFiles}`); diff --git a/scripts/generateTranslations.ts b/scripts/generateTranslations.ts index 9a2937cb874b..411a1db7db60 100755 --- a/scripts/generateTranslations.ts +++ b/scripts/generateTranslations.ts @@ -551,7 +551,9 @@ class TranslationGenerator { if (this.verbose) { console.debug('😵‍💫 Encountered complex template, recursively translating its spans first:', node.getText()); } - node.templateSpans.forEach((span) => this.extractStringsToTranslate(span, stringsToTranslate, currentPath)); + for (const span of node.templateSpans) { + this.extractStringsToTranslate(span, stringsToTranslate, currentPath); + } stringsToTranslate.set(translationKey, {text: this.templateExpressionToString(node), context}); } } diff --git a/scripts/utils/parseCommandLineArguments.ts b/scripts/utils/parseCommandLineArguments.ts index 9bb1d340335e..e6ac8b15ab8f 100644 --- a/scripts/utils/parseCommandLineArguments.ts +++ b/scripts/utils/parseCommandLineArguments.ts @@ -4,7 +4,7 @@ type ArgsMap = Record; export default function parseCommandLineArguments(): ArgsMap { const args = process.argv.slice(2); // Skip node and script paths const argsMap: ArgsMap = {}; - args.forEach((arg) => { + for (const arg of args) { const [key, value] = arg.split('='); if (key.startsWith('--')) { const name = key.substring(2); @@ -14,6 +14,6 @@ export default function parseCommandLineArguments(): ArgsMap { argsMap[name] = 'true'; } } - }); + } return argsMap; } diff --git a/src/NAICS.ts b/src/NAICS.ts index 869ea9499dd1..b8bcc9687d38 100755 --- a/src/NAICS.ts +++ b/src/NAICS.ts @@ -12144,18 +12144,18 @@ function getNAICSMappingWithId(item: NAICSItem) { }; }); - item.options.forEach((option) => { + for (const option of item.options) { if (option.options.length === 0) { - return; + continue; } getNAICSMappingWithId(option); - }); + } } function buildNAICS() { - NAICS.forEach((item) => { + for (const item of NAICS) { getNAICSMappingWithId(item); - }); + } } buildNAICS(); diff --git a/src/components/AddPlaidBankAccount.tsx b/src/components/AddPlaidBankAccount.tsx index 4c50576b5417..1394a7138a0a 100644 --- a/src/components/AddPlaidBankAccount.tsx +++ b/src/components/AddPlaidBankAccount.tsx @@ -128,7 +128,9 @@ function AddPlaidBankAccount({ * Unblocks the keyboard shortcuts that can navigate */ const unsubscribeToNavigationShortcuts = () => { - subscribedKeyboardShortcuts.current.forEach((unsubscribe) => unsubscribe()); + for (const unsubscribe of subscribedKeyboardShortcuts.current) { + unsubscribe(); + } subscribedKeyboardShortcuts.current = []; }; diff --git a/src/components/AddressForm.tsx b/src/components/AddressForm.tsx index eec78316534c..a9be595ad7f6 100644 --- a/src/components/AddressForm.tsx +++ b/src/components/AddressForm.tsx @@ -99,14 +99,14 @@ function AddressForm({ } // Add "Field required" errors if any required field is empty - requiredFields.forEach((fieldKey) => { + for (const fieldKey of requiredFields) { const fieldValue = values[fieldKey] ?? ''; if (isRequiredFulfilled(fieldValue)) { - return; + continue; } errors[fieldKey] = translate('common.error.fieldRequired'); - }); + } if (values.addressLine1.length > CONST.FORM_CHARACTER_LIMIT) { errors.addressLine1 = translate('common.error.characterLimitExceedCounter', { diff --git a/src/components/AddressSearch/index.tsx b/src/components/AddressSearch/index.tsx index ac27c32700b3..259bdc5afd20 100644 --- a/src/components/AddressSearch/index.tsx +++ b/src/components/AddressSearch/index.tsx @@ -228,13 +228,13 @@ function AddressSearch({ } if (inputID) { - Object.entries(values).forEach(([key, inputValue]) => { + for (const [key, inputValue] of Object.entries(values)) { const inputKey = renamedInputKeys?.[key as keyof Omit] ?? key; if (!inputKey) { - return; + continue; } onInputChange?.(inputValue, inputKey); - }); + } } else { onInputChange?.(values); } diff --git a/src/components/AttachmentPicker/index.native.tsx b/src/components/AttachmentPicker/index.native.tsx index 063dece52985..d4cedd8f31ad 100644 --- a/src/components/AttachmentPicker/index.native.tsx +++ b/src/components/AttachmentPicker/index.native.tsx @@ -188,10 +188,10 @@ function AttachmentPicker({ } }; - assets.forEach((asset) => { + for (const asset of assets) { if (!asset.uri) { checkAllProcessed(); - return; + continue; } if (asset.type?.startsWith('image')) { @@ -238,7 +238,7 @@ function AttachmentPicker({ processedAssets.push(processedAsset); checkAllProcessed(); } - }); + } }); }), [fileLimit, showGeneralAlert, type], diff --git a/src/components/Attachments/AttachmentCarousel/extractAttachments.ts b/src/components/Attachments/AttachmentCarousel/extractAttachments.ts index 2c265030b61f..6dffd994d6a7 100644 --- a/src/components/Attachments/AttachmentCarousel/extractAttachments.ts +++ b/src/components/Attachments/AttachmentCarousel/extractAttachments.ts @@ -116,9 +116,9 @@ function extractAttachments( } const actions = [...(parentReportAction ? [parentReportAction] : []), ...getSortedReportActions(Object.values(reportActions ?? {}))]; - actions.forEach((action, key) => { + for (const [key, action] of actions.entries()) { if (!shouldReportActionBeVisible(action, key, canUserPerformAction) || isMoneyRequestAction(action)) { - return; + continue; } const decision = getReportActionMessage(action)?.moderationDecision?.decision; @@ -127,7 +127,7 @@ function extractAttachments( .replaceAll('/>', `data-flagged="${hasBeenFlagged}" data-id="${action.reportActionID}"/>`) .replaceAll('