diff --git a/.github/actions/javascript/authorChecklist/index.js b/.github/actions/javascript/authorChecklist/index.js index 8703e99a3883..6f9905312e7b 100644 --- a/.github/actions/javascript/authorChecklist/index.js +++ b/.github/actions/javascript/authorChecklist/index.js @@ -15875,8 +15875,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -15892,7 +15891,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -15901,7 +15900,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/awaitStagingDeploys/index.js b/.github/actions/javascript/awaitStagingDeploys/index.js index 67dd505705f0..cf48135dd221 100644 --- a/.github/actions/javascript/awaitStagingDeploys/index.js +++ b/.github/actions/javascript/awaitStagingDeploys/index.js @@ -12679,8 +12679,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -12696,7 +12695,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -12705,7 +12704,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/checkAndroidStatus/index.js b/.github/actions/javascript/checkAndroidStatus/index.js index d926380a0306..15042eba0ba9 100644 --- a/.github/actions/javascript/checkAndroidStatus/index.js +++ b/.github/actions/javascript/checkAndroidStatus/index.js @@ -737422,8 +737422,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -737439,7 +737438,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -737448,7 +737447,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/checkDeployBlockers/index.js b/.github/actions/javascript/checkDeployBlockers/index.js index bde652bb65b8..c89841b07bc9 100644 --- a/.github/actions/javascript/checkDeployBlockers/index.js +++ b/.github/actions/javascript/checkDeployBlockers/index.js @@ -11946,8 +11946,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -11963,7 +11962,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -11972,7 +11971,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/checkSVGCompression/index.js b/.github/actions/javascript/checkSVGCompression/index.js index bd1bcbeda95e..33f9c06c00f4 100644 --- a/.github/actions/javascript/checkSVGCompression/index.js +++ b/.github/actions/javascript/checkSVGCompression/index.js @@ -20471,8 +20471,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -20488,7 +20487,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -20497,7 +20496,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/createOrUpdateStagingDeploy/index.js b/.github/actions/javascript/createOrUpdateStagingDeploy/index.js index 3b3a72b093f2..720fbd5dccd8 100644 --- a/.github/actions/javascript/createOrUpdateStagingDeploy/index.js +++ b/.github/actions/javascript/createOrUpdateStagingDeploy/index.js @@ -12233,8 +12233,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -12250,7 +12249,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -12259,7 +12258,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/formatCodeCovComment/index.js b/.github/actions/javascript/formatCodeCovComment/index.js index a2463838c627..3341eb6f5d88 100644 --- a/.github/actions/javascript/formatCodeCovComment/index.js +++ b/.github/actions/javascript/formatCodeCovComment/index.js @@ -12133,8 +12133,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -12150,7 +12149,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -12159,7 +12158,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/getArtifactInfo/index.js b/.github/actions/javascript/getArtifactInfo/index.js index 410e81c8e543..602f76d58fd8 100644 --- a/.github/actions/javascript/getArtifactInfo/index.js +++ b/.github/actions/javascript/getArtifactInfo/index.js @@ -11907,8 +11907,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -11924,7 +11923,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -11933,7 +11932,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/getDeployPullRequestList/index.js b/.github/actions/javascript/getDeployPullRequestList/index.js index 7f8090725d3c..d8cc6b258411 100644 --- a/.github/actions/javascript/getDeployPullRequestList/index.js +++ b/.github/actions/javascript/getDeployPullRequestList/index.js @@ -12252,8 +12252,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -12269,7 +12268,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -12278,7 +12277,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/getPreviousVersion/index.js b/.github/actions/javascript/getPreviousVersion/index.js index ad5e2462e86d..8f6e8676d172 100644 --- a/.github/actions/javascript/getPreviousVersion/index.js +++ b/.github/actions/javascript/getPreviousVersion/index.js @@ -12063,8 +12063,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -12080,7 +12079,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -12089,7 +12088,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/getPullRequestDetails/index.js b/.github/actions/javascript/getPullRequestDetails/index.js index 3fb0799f7f94..3fbe0d9bdc05 100644 --- a/.github/actions/javascript/getPullRequestDetails/index.js +++ b/.github/actions/javascript/getPullRequestDetails/index.js @@ -12036,8 +12036,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -12053,7 +12052,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -12062,7 +12061,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/getPullRequestIncrementalChanges/index.js b/.github/actions/javascript/getPullRequestIncrementalChanges/index.js index 86b18f8a1f54..3844a9e41673 100644 --- a/.github/actions/javascript/getPullRequestIncrementalChanges/index.js +++ b/.github/actions/javascript/getPullRequestIncrementalChanges/index.js @@ -12138,8 +12138,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -12155,7 +12154,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -12164,7 +12163,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/isStagingDeployLocked/index.js b/.github/actions/javascript/isStagingDeployLocked/index.js index 58cea7e0027d..05f5c97c5711 100644 --- a/.github/actions/javascript/isStagingDeployLocked/index.js +++ b/.github/actions/javascript/isStagingDeployLocked/index.js @@ -11907,8 +11907,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -11924,7 +11923,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -11933,7 +11932,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/markPullRequestsAsDeployed/index.js b/.github/actions/javascript/markPullRequestsAsDeployed/index.js index e1f5bdb9afa1..8d0acf0697a7 100644 --- a/.github/actions/javascript/markPullRequestsAsDeployed/index.js +++ b/.github/actions/javascript/markPullRequestsAsDeployed/index.js @@ -13360,8 +13360,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -13377,7 +13376,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -13386,7 +13385,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/postTestBuildComment/index.js b/.github/actions/javascript/postTestBuildComment/index.js index 5062a8823db5..7bd635262af6 100644 --- a/.github/actions/javascript/postTestBuildComment/index.js +++ b/.github/actions/javascript/postTestBuildComment/index.js @@ -12037,8 +12037,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -12054,7 +12053,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -12063,7 +12062,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/proposalPoliceComment/index.js b/.github/actions/javascript/proposalPoliceComment/index.js index 65c1c568adec..00ba48ef3ac4 100644 --- a/.github/actions/javascript/proposalPoliceComment/index.js +++ b/.github/actions/javascript/proposalPoliceComment/index.js @@ -12176,8 +12176,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -12193,7 +12192,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -12202,7 +12201,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/reopenIssueWithComment/index.js b/.github/actions/javascript/reopenIssueWithComment/index.js index 2eb37a3ad9f7..7e47116033b2 100644 --- a/.github/actions/javascript/reopenIssueWithComment/index.js +++ b/.github/actions/javascript/reopenIssueWithComment/index.js @@ -11917,8 +11917,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -11934,7 +11933,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -11943,7 +11942,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/reviewerChecklist/index.js b/.github/actions/javascript/reviewerChecklist/index.js index 073820e9f47b..d7a93db68979 100644 --- a/.github/actions/javascript/reviewerChecklist/index.js +++ b/.github/actions/javascript/reviewerChecklist/index.js @@ -12009,8 +12009,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -12026,7 +12025,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -12035,7 +12034,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/actions/javascript/verifySignedCommits/index.js b/.github/actions/javascript/verifySignedCommits/index.js index d3ef98f57599..e46c499e3ea7 100644 --- a/.github/actions/javascript/verifySignedCommits/index.js +++ b/.github/actions/javascript/verifySignedCommits/index.js @@ -11949,8 +11949,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b)); const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b)); @@ -11966,7 +11965,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -11975,7 +11974,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/.github/libs/GithubUtils.ts b/.github/libs/GithubUtils.ts index 1743cc592c9f..8acedc4229a0 100644 --- a/.github/libs/GithubUtils.ts +++ b/.github/libs/GithubUtils.ts @@ -334,8 +334,7 @@ class GithubUtils { const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : []; console.log('Found the following NO QA PRs:', noQAPRs); - // eslint-disable-next-line unicorn/prefer-set-has - const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])]; + const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]); const sortedPRList = [...new Set(arrayDifference(PRList, Object.keys(internalQAPRMap)))].sort( (a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b), @@ -362,7 +361,7 @@ class GithubUtils { if (sortedPRList.length > 0) { issueBody += '**This release contains changes from the following pull requests:**\r\n'; sortedPRList.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; @@ -372,7 +371,7 @@ class GithubUtils { if (sortedPRListMobileExpensify.length > 0) { issueBody += '**Mobile-Expensify PRs:**\r\n'; sortedPRListMobileExpensify.forEach((URL) => { - issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]'; + issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]'; issueBody += ` ${URL}\r\n`; }); issueBody += '\r\n\r\n'; diff --git a/scripts/stubReactNative.js b/scripts/stubReactNative.js index c68631ee344a..31780835739e 100644 --- a/scripts/stubReactNative.js +++ b/scripts/stubReactNative.js @@ -4,8 +4,7 @@ const Module = require('module'); const originalRequire = Module.prototype.require; // List of modules to stub (we don't need these in scripts) -// eslint-disable-next-line unicorn/prefer-set-has -const MODULES_TO_STUB = [ +const MODULES_TO_STUB = new Set([ 'react-native', 'react-native-config', 'react-native-key-command', @@ -21,7 +20,7 @@ const MODULES_TO_STUB = [ 'react-native-onyx', '@react-navigation/native', 'expo-av', -]; +]); // Stub implementations const STUBS = { @@ -63,7 +62,7 @@ Module.prototype.require = function (...args) { const id = args[0]; // Check if this is a module we want to stub - if (MODULES_TO_STUB.includes(id) || id.startsWith('react-native')) { + if (MODULES_TO_STUB.has(id) || id.startsWith('react-native')) { const stub = STUBS[id] || {}; return {__esModule: true, default: stub, ...stub}; } diff --git a/src/components/ScrollOffsetContextProvider.tsx b/src/components/ScrollOffsetContextProvider.tsx index 434acd738735..e6b211ef637d 100644 --- a/src/components/ScrollOffsetContextProvider.tsx +++ b/src/components/ScrollOffsetContextProvider.tsx @@ -101,8 +101,7 @@ function ScrollOffsetContextProvider({children}: ScrollOffsetContextProviderProp const cleanStaleScrollOffsets: ScrollOffsetContextValue['cleanStaleScrollOffsets'] = useCallback( (state) => { const sidebarRoutes = state.routes.filter((route) => isSidebarScreenName(route.name)); - // eslint-disable-next-line unicorn/prefer-set-has - const existingScreenKeys = sidebarRoutes.map(getKey); + const existingScreenKeys = new Set(sidebarRoutes.map(getKey)); const focusedRoute = findFocusedRoute(state); const routeName = focusedRoute?.name; @@ -117,7 +116,7 @@ function ScrollOffsetContextProvider({children}: ScrollOffsetContextProviderProp cleanScrollOffsets(scrollOffsetKeys, (key) => key.startsWith(SCREENS.SEARCH.ROOT) && key !== currentKey && !isSearchMoneyRequestReport); return; } - cleanScrollOffsets(scrollOffsetKeys, (key) => !existingScreenKeys.includes(key)); + cleanScrollOffsets(scrollOffsetKeys, (key) => !existingScreenKeys.has(key)); }, [cleanScrollOffsets], ); diff --git a/src/components/Search/SearchAutocompleteList.tsx b/src/components/Search/SearchAutocompleteList.tsx index 8c4bcb15ca6e..3cda7e435e24 100644 --- a/src/components/Search/SearchAutocompleteList.tsx +++ b/src/components/Search/SearchAutocompleteList.tsx @@ -331,20 +331,19 @@ function SearchAutocompleteList({ } } - // eslint-disable-next-line unicorn/prefer-set-has - const alreadyAutocompletedKeys = ranges - .filter((range) => { - return autocompleteKey && range.key === autocompleteKey; - }) - .map((range) => range.value.toLowerCase()); + const alreadyAutocompletedKeys = new Set( + ranges + .filter((range) => { + return autocompleteKey && range.key === autocompleteKey; + }) + .map((range) => range.value.toLowerCase()), + ); switch (autocompleteKey) { case CONST.SEARCH.SYNTAX_FILTER_KEYS.TAG: { const autocompleteList = autocompleteValue ? tagAutocompleteList : (recentTagsAutocompleteList ?? []); const filteredTags = autocompleteList - .filter( - (tag) => getCleanedTagName(tag).toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(getCleanedTagName(tag).toLowerCase()), - ) + .filter((tag) => getCleanedTagName(tag).toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(getCleanedTagName(tag).toLowerCase())) .sort() .slice(0, 10); @@ -358,7 +357,7 @@ function SearchAutocompleteList({ case CONST.SEARCH.SYNTAX_FILTER_KEYS.CATEGORY: { const autocompleteList = autocompleteValue ? categoryAutocompleteList : recentCategoriesAutocompleteList; const filteredCategories = autocompleteList - .filter((category) => category?.toLowerCase()?.includes(autocompleteValue?.toLowerCase()) && !alreadyAutocompletedKeys.includes(category?.toLowerCase())) + .filter((category) => category?.toLowerCase()?.includes(autocompleteValue?.toLowerCase()) && !alreadyAutocompletedKeys.has(category?.toLowerCase())) .sort() .slice(0, 10); @@ -375,7 +374,7 @@ function SearchAutocompleteList({ case CONST.SEARCH.SYNTAX_FILTER_KEYS.PURCHASE_CURRENCY: { const autocompleteList = autocompleteValue ? currencyAutocompleteList : (recentCurrencyAutocompleteList ?? []); const filteredCurrencies = autocompleteList - .filter((currency) => currency.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(currency.toLowerCase())) + .filter((currency) => currency.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(currency.toLowerCase())) .sort() .slice(0, 10); @@ -386,7 +385,7 @@ function SearchAutocompleteList({ } case CONST.SEARCH.SYNTAX_FILTER_KEYS.TAX_RATE: { const filteredTaxRates = taxAutocompleteList - .filter((tax) => tax.taxRateName.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(tax.taxRateName.toLowerCase())) + .filter((tax) => tax.taxRateName.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(tax.taxRateName.toLowerCase())) .sort() .slice(0, 10); @@ -417,7 +416,7 @@ function SearchAutocompleteList({ includeCurrentUser: true, countryCode, shouldShowGBR: true, - }).personalDetails.filter((participant) => participant.text && !alreadyAutocompletedKeys.includes(participant.text.toLowerCase())); + }).personalDetails.filter((participant) => participant.text && !alreadyAutocompletedKeys.has(participant.text.toLowerCase())); return participants.map((participant) => ({ filterKey: autocompleteKey, @@ -452,29 +451,27 @@ function SearchAutocompleteList({ } case CONST.SEARCH.SYNTAX_ROOT_KEYS.TYPE: { const filteredTypes = typeAutocompleteList - .filter((type) => type.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(type.toLowerCase())) + .filter((type) => type.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(type.toLowerCase())) .sort(); return filteredTypes.map((type) => ({filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.TYPE, text: type})); } case CONST.SEARCH.SYNTAX_ROOT_KEYS.GROUP_BY: { const filteredGroupBy = groupByAutocompleteList.filter( - (groupByValue) => groupByValue.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(groupByValue.toLowerCase()), + (groupByValue) => groupByValue.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(groupByValue.toLowerCase()), ); return filteredGroupBy.map((groupByValue) => ({filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.GROUP_BY, text: groupByValue})); } case CONST.SEARCH.SYNTAX_ROOT_KEYS.STATUS: { const filteredStatuses = statusAutocompleteList - .filter((status) => status.includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(status)) + .filter((status) => status.includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(status)) .sort() .slice(0, 10); return filteredStatuses.map((status) => ({filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.STATUS, text: status})); } case CONST.SEARCH.SYNTAX_FILTER_KEYS.EXPENSE_TYPE: { - const filteredExpenseTypes = expenseTypes - .filter((expenseType) => expenseType.includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(expenseType)) - .sort(); + const filteredExpenseTypes = expenseTypes.filter((expenseType) => expenseType.includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(expenseType)).sort(); return filteredExpenseTypes.map((expenseType) => ({ filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.EXPENSE_TYPE, @@ -483,7 +480,7 @@ function SearchAutocompleteList({ } case CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_TYPE: { const filteredWithdrawalTypes = withdrawalTypes - .filter((withdrawalType) => withdrawalType.includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(withdrawalType)) + .filter((withdrawalType) => withdrawalType.includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(withdrawalType)) .sort(); return filteredWithdrawalTypes.map((withdrawalType) => ({ @@ -493,7 +490,7 @@ function SearchAutocompleteList({ } case CONST.SEARCH.SYNTAX_FILTER_KEYS.FEED: { const filteredFeeds = feedAutoCompleteList - .filter((feed) => feed.name.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(feed.name.toLowerCase())) + .filter((feed) => feed.name.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(feed.name.toLowerCase())) .sort() .slice(0, 10); return filteredFeeds.map((feed) => ({ @@ -509,7 +506,7 @@ function SearchAutocompleteList({ .filter( (card) => (card.bank.toLowerCase().includes(autocompleteValue.toLowerCase()) || card.lastFourPAN?.includes(autocompleteValue)) && - !alreadyAutocompletedKeys.includes(getCardDescription(card).toLowerCase()), + !alreadyAutocompletedKeys.has(getCardDescription(card).toLowerCase()), ) .sort() .slice(0, 10); @@ -523,7 +520,7 @@ function SearchAutocompleteList({ } case CONST.SEARCH.SYNTAX_FILTER_KEYS.REIMBURSABLE: case CONST.SEARCH.SYNTAX_FILTER_KEYS.BILLABLE: { - const filteredValues = booleanTypes.filter((value) => value.includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(value)).sort(); + const filteredValues = booleanTypes.filter((value) => value.includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(value)).sort(); return filteredValues.map((value) => ({ filterKey: autocompleteKey, @@ -532,7 +529,7 @@ function SearchAutocompleteList({ } case CONST.SEARCH.SYNTAX_FILTER_KEYS.POLICY_ID: { const filteredPolicies = workspaceList - .filter((workspace) => workspace.name.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(workspace.name.toLowerCase())) + .filter((workspace) => workspace.name.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(workspace.name.toLowerCase())) .sort() .slice(0, 10); @@ -545,7 +542,7 @@ function SearchAutocompleteList({ } case CONST.SEARCH.SYNTAX_FILTER_KEYS.ACTION: { const filteredActionTypes = Object.values(CONST.SEARCH.ACTION_FILTERS).filter((actionType) => { - return actionType.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(actionType.toLowerCase()); + return actionType.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(actionType.toLowerCase()); }); return filteredActionTypes.map((action) => ({ @@ -555,7 +552,7 @@ function SearchAutocompleteList({ } case CONST.SEARCH.SYNTAX_FILTER_KEYS.HAS: { const filteredHasValues = hasAutocompleteList.filter((hasValue) => { - return hasValue.value.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(hasValue.value.toLowerCase()); + return hasValue.value.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(hasValue.value.toLowerCase()); }); return filteredHasValues.map((hasValue) => ({ @@ -565,7 +562,7 @@ function SearchAutocompleteList({ } case CONST.SEARCH.SYNTAX_FILTER_KEYS.IS: { const filteredIsValues = isAutocompleteList.filter((isValue) => { - return isValue.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(isValue.toLowerCase()); + return isValue.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(isValue.toLowerCase()); }); return filteredIsValues.map((isValue) => ({filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.IS, text: isValue})); @@ -578,7 +575,7 @@ function SearchAutocompleteList({ case CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWN: case CONST.SEARCH.SYNTAX_FILTER_KEYS.POSTED: { const filteredDatePresets = getDatePresets(autocompleteKey, true) - .filter((datePreset) => datePreset.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(datePreset.toLowerCase())) + .filter((datePreset) => datePreset.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(datePreset.toLowerCase())) .sort() .slice(0, 10); return filteredDatePresets.map((datePreset) => ({filterKey: autocompleteKey, text: datePreset})); diff --git a/src/components/Search/SearchPageHeader/SearchFiltersBar.tsx b/src/components/Search/SearchPageHeader/SearchFiltersBar.tsx index 46544f65ad20..aef844e14ffe 100644 --- a/src/components/Search/SearchPageHeader/SearchFiltersBar.tsx +++ b/src/components/Search/SearchPageHeader/SearchFiltersBar.tsx @@ -618,16 +618,17 @@ function SearchFiltersBar({ const hiddenSelectedFilters = useMemo(() => { const advancedSearchFiltersKeys = typeFiltersKeys.flat(); - // eslint-disable-next-line unicorn/prefer-set-has - const exposedFiltersKeys = filters.flatMap((filter) => { - const dateFilterKey = DATE_FILTER_KEYS.find((key) => filter.filterKey.startsWith(key)); - if (dateFilterKey) { - return dateFilterKey; - } - return filter.filterKey; - }); + const exposedFiltersKeys = new Set( + filters.flatMap((filter) => { + const dateFilterKey = DATE_FILTER_KEYS.find((key) => filter.filterKey.startsWith(key)); + if (dateFilterKey) { + return dateFilterKey; + } + return filter.filterKey; + }), + ); - const hiddenFilters = advancedSearchFiltersKeys.filter((key) => !exposedFiltersKeys.includes(key as SearchAdvancedFiltersKey)); + const hiddenFilters = advancedSearchFiltersKeys.filter((key) => !exposedFiltersKeys.has(key as SearchAdvancedFiltersKey)); const hasReportFields = Object.keys(filterFormValues).some((key) => key.startsWith(CONST.SEARCH.REPORT_FIELD.GLOBAL_PREFIX) && !key.startsWith(CONST.SEARCH.REPORT_FIELD.NOT_PREFIX)); return hiddenFilters.filter((key) => { diff --git a/src/components/TagPicker.tsx b/src/components/TagPicker.tsx index 9de3e33731b3..48220118331a 100644 --- a/src/components/TagPicker.tsx +++ b/src/components/TagPicker.tsx @@ -99,10 +99,9 @@ function TagPicker({ }); } - // eslint-disable-next-line unicorn/prefer-set-has - const selectedNames = selectedOptions.map((s) => s.name); + const selectedNames = new Set(selectedOptions.map((s) => s.name)); - return [...selectedOptions, ...Object.values(policyTagList.tags).filter((policyTag) => policyTag.enabled && !selectedNames.includes(policyTag.name))]; + return [...selectedOptions, ...Object.values(policyTagList.tags).filter((policyTag) => policyTag.enabled && !selectedNames.has(policyTag.name))]; }, [shouldShowDisabledAndSelectedOption, hasDependentTags, selectedOptions, policyTagList.tags, transactionTag, tagListIndex]); const availableTagsCount = Array.isArray(enabledTags) ? enabledTags.length : Object.keys(enabledTags).length; diff --git a/src/components/UploadFile.tsx b/src/components/UploadFile.tsx index 0d4704c0cd8b..5a4eeb705335 100644 --- a/src/components/UploadFile.tsx +++ b/src/components/UploadFile.tsx @@ -85,19 +85,17 @@ function UploadFile({ } if (acceptedFileTypes.length > 0) { - // eslint-disable-next-line unicorn/prefer-set-has - const filesExtensions = files.map((file) => splitExtensionFromFileName(file?.name ?? '').fileExtension.toLowerCase()); + const filesExtensions = new Set(files.map((file) => splitExtensionFromFileName(file?.name ?? '').fileExtension.toLowerCase())); - if (acceptedFileTypes.every((element) => !filesExtensions.includes(element as string))) { + if (acceptedFileTypes.every((element) => !filesExtensions.has(element as string))) { setError(translate('attachmentPicker.notAllowedExtension')); return; } } - // eslint-disable-next-line unicorn/prefer-set-has - const uploadedFilesNames = uploadedFiles.map((uploadedFile) => uploadedFile.name); + const uploadedFilesNames = new Set(uploadedFiles.map((uploadedFile) => uploadedFile.name)); - const newFilesToUpload = files.filter((file) => !uploadedFilesNames.includes(file.name)); + const newFilesToUpload = files.filter((file) => !uploadedFilesNames.has(file.name)); onInputChange(newFilesToUpload); onUpload(newFilesToUpload); diff --git a/src/hooks/useAdvancedSearchFilters.ts b/src/hooks/useAdvancedSearchFilters.ts index 8a9cfd839c1d..f938fd00615d 100644 --- a/src/hooks/useAdvancedSearchFilters.ts +++ b/src/hooks/useAdvancedSearchFilters.ts @@ -241,11 +241,12 @@ function useAdvancedSearchFilters() { }); // When looking if a user has any categories to display, we want to ignore the policies that are of type PERSONAL - // eslint-disable-next-line unicorn/prefer-set-has - const nonPersonalPolicyCategoryIds = Object.values(policies) - .filter((policy): policy is NonNullable => !!(policy && policy.type !== CONST.POLICY.TYPE.PERSONAL)) - .map((policy) => `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policy.id}`); - const nonPersonalPolicyCategoryCount = Object.keys(allPolicyCategories).filter((policyCategoryId) => nonPersonalPolicyCategoryIds.includes(policyCategoryId)).length; + const nonPersonalPolicyCategoryIds = new Set( + Object.values(policies) + .filter((policy): policy is NonNullable => !!(policy && policy.type !== CONST.POLICY.TYPE.PERSONAL)) + .map((policy) => `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policy.id}`), + ); + const nonPersonalPolicyCategoryCount = Object.keys(allPolicyCategories).filter((policyCategoryId) => nonPersonalPolicyCategoryIds.has(policyCategoryId)).length; const areCategoriesEnabled = isFeatureEnabledInPolicies(policies, CONST.POLICY.MORE_FEATURES.ARE_CATEGORIES_ENABLED); const areTagsEnabled = isFeatureEnabledInPolicies(policies, CONST.POLICY.MORE_FEATURES.ARE_TAGS_ENABLED); diff --git a/src/hooks/useDeleteTransactions.ts b/src/hooks/useDeleteTransactions.ts index a0e861164753..2174391478e4 100644 --- a/src/hooks/useDeleteTransactions.ts +++ b/src/hooks/useDeleteTransactions.ts @@ -90,10 +90,9 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac ); Object.keys(splitTransactionsByOriginalTransactionID).forEach((transactionID) => { - // eslint-disable-next-line unicorn/prefer-set-has - const splitIDs = (splitTransactionsByOriginalTransactionID[transactionID] ?? []).map((transaction) => transaction.transactionID); + const splitIDs = new Set((splitTransactionsByOriginalTransactionID[transactionID] ?? []).map((transaction) => transaction.transactionID)); const childTransactions = getChildTransactions(allTransactions, allReports, transactionID).filter( - (transaction) => !splitIDs.includes(transaction?.transactionID ?? String(CONST.DEFAULT_NUMBER_ID)), + (transaction) => !splitIDs.has(transaction?.transactionID ?? String(CONST.DEFAULT_NUMBER_ID)), ); if (childTransactions.length === 0) { diff --git a/src/hooks/useSidebarOrderedReports.tsx b/src/hooks/useSidebarOrderedReports.tsx index f06b006a826e..def62f1f6308 100644 --- a/src/hooks/useSidebarOrderedReports.tsx +++ b/src/hooks/useSidebarOrderedReports.tsx @@ -111,15 +111,14 @@ function SidebarOrderedReportsContextProvider({ } else if (reportsDraftsUpdates) { reportsToUpdate = Object.keys(reportsDraftsUpdates).map((key) => key.replace(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, ONYXKEYS.COLLECTION.REPORT)); } else if (policiesUpdates) { - // eslint-disable-next-line unicorn/prefer-set-has - const updatedPolicies = Object.keys(policiesUpdates).map((key) => key.replace(ONYXKEYS.COLLECTION.POLICY, '')); + const updatedPolicies = new Set(Object.keys(policiesUpdates).map((key) => key.replace(ONYXKEYS.COLLECTION.POLICY, ''))); reportsToUpdate = Object.entries(chatReports ?? {}) .filter(([, value]) => { if (!value?.policyID) { return; } - return updatedPolicies.includes(value.policyID); + return updatedPolicies.has(value.policyID); }) .map(([key]) => key); } diff --git a/src/libs/CardUtils.ts b/src/libs/CardUtils.ts index 652e0cfeeb81..8a8a6faabc11 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -529,8 +529,7 @@ function isSelectedFeedExpired(directFeed: DirectCardFeedData | undefined): bool /** Returns list of cards which can be assigned */ function getFilteredCardList(list: WorkspaceCardsList | undefined, directFeed: DirectCardFeedData | undefined, workspaceCardFeeds: OnyxCollection) { const {cardList: customFeedCardsToAssign, ...cards} = list ?? {}; - // eslint-disable-next-line unicorn/prefer-set-has - const assignedCards = Object.values(cards).map((card) => card.cardName); + const assignedCards = new Set(Object.values(cards).map((card) => card.cardName)); // Get cards assigned across all workspaces const allWorkspaceAssignedCards = new Set(); @@ -548,11 +547,11 @@ function getFilteredCardList(list: WorkspaceCardsList | undefined, directFeed: D }); if (directFeed) { - const unassignedDirectFeedCards = directFeed.accountList.filter((cardNumber) => !assignedCards.includes(cardNumber) && !allWorkspaceAssignedCards.has(cardNumber)); + const unassignedDirectFeedCards = directFeed.accountList.filter((cardNumber) => !assignedCards.has(cardNumber) && !allWorkspaceAssignedCards.has(cardNumber)); return Object.fromEntries(unassignedDirectFeedCards.map((cardNumber) => [cardNumber, cardNumber])); } - return Object.fromEntries(Object.entries(customFeedCardsToAssign ?? {}).filter(([cardNumber]) => !assignedCards.includes(cardNumber) && !allWorkspaceAssignedCards.has(cardNumber))); + return Object.fromEntries(Object.entries(customFeedCardsToAssign ?? {}).filter(([cardNumber]) => !assignedCards.has(cardNumber) && !allWorkspaceAssignedCards.has(cardNumber))); } function hasOnlyOneCardToAssign(list: FilteredCardList) { @@ -577,9 +576,8 @@ function checkIfNewFeedConnected(prevFeedsData: CompanyFeeds, currentFeedsData: } function filterInactiveCards(cards: CardList | undefined): CardList { - // eslint-disable-next-line unicorn/prefer-set-has - const closedStates: number[] = [CONST.EXPENSIFY_CARD.STATE.CLOSED, CONST.EXPENSIFY_CARD.STATE.STATE_DEACTIVATED, CONST.EXPENSIFY_CARD.STATE.STATE_SUSPENDED]; - return filterObject(cards ?? {}, (key, card) => !closedStates.includes(card.state)); + const closedStates = new Set([CONST.EXPENSIFY_CARD.STATE.CLOSED, CONST.EXPENSIFY_CARD.STATE.STATE_DEACTIVATED, CONST.EXPENSIFY_CARD.STATE.STATE_SUSPENDED]); + return filterObject(cards ?? {}, (key, card) => !closedStates.has(card.state)); } function getAllCardsForWorkspace( diff --git a/src/libs/CategoryOptionListUtils.ts b/src/libs/CategoryOptionListUtils.ts index be2569e8447b..75e5c863ec87 100644 --- a/src/libs/CategoryOptionListUtils.ts +++ b/src/libs/CategoryOptionListUtils.ts @@ -104,14 +104,13 @@ function getCategoryListSections({ }): CategoryTreeSection[] { const sortedCategories = sortCategories(categories, localeCompare); const enabledCategories = Object.values(sortedCategories).filter((category) => category.enabled); - // eslint-disable-next-line unicorn/prefer-set-has - const enabledCategoriesNames = enabledCategories.map((category) => category.name); + const enabledCategoriesNames = new Set(enabledCategories.map((category) => category.name)); const selectedOptionsWithDisabledState: Category[] = []; const categorySections: CategoryTreeSection[] = []; const numberOfEnabledCategories = enabledCategories.length; selectedOptions.forEach((option) => { - if (enabledCategoriesNames.includes(option.name)) { + if (enabledCategoriesNames.has(option.name)) { const categoryObj = enabledCategories.find((category) => category.name === option.name); selectedOptionsWithDisabledState.push({...(categoryObj ?? option), isSelected: true, enabled: true}); return; @@ -163,9 +162,8 @@ function getCategoryListSections({ }); } - // eslint-disable-next-line unicorn/prefer-set-has - const selectedOptionNames = selectedOptions.map((selectedOption) => selectedOption.name); - const filteredCategories = enabledCategories.filter((category) => !selectedOptionNames.includes(category.name)); + const selectedOptionNames = new Set(selectedOptions.map((selectedOption) => selectedOption.name)); + const filteredCategories = enabledCategories.filter((category) => !selectedOptionNames.has(category.name)); if (numberOfEnabledCategories < CONST.STANDARD_LIST_ITEM_LIMIT) { const data = getCategoryOptionTree(filteredCategories, false, selectedOptionsWithDisabledState); @@ -183,7 +181,7 @@ function getCategoryListSections({ const filteredRecentlyUsedCategories = recentlyUsedCategories .filter( (categoryName) => - !selectedOptionNames.includes(categoryName) && categories[categoryName]?.enabled && categories[categoryName]?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, + !selectedOptionNames.has(categoryName) && categories[categoryName]?.enabled && categories[categoryName]?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, ) .map((categoryName) => ({ name: categoryName, diff --git a/src/libs/ExportOnyxState/common.ts b/src/libs/ExportOnyxState/common.ts index a2a76551dbec..bb5504c1922e 100644 --- a/src/libs/ExportOnyxState/common.ts +++ b/src/libs/ExportOnyxState/common.ts @@ -75,8 +75,7 @@ const ONYX_KEY_EXPORT_RULES: Record = { }, }; -// eslint-disable-next-line unicorn/prefer-set-has -const onyxKeysToRemove: Array> = [ +const onyxKeysToRemove = new Set>([ ONYXKEYS.NVP_PRIVATE_PUSH_NOTIFICATION_ID, ONYXKEYS.NVP_PRIVATE_STRIPE_CUSTOMER_ID, ONYXKEYS.NVP_PRIVATE_BILLING_DISPUTE_PENDING, @@ -84,10 +83,9 @@ const onyxKeysToRemove: Array> = [ ONYXKEYS.PLAID_LINK_TOKEN, ONYXKEYS.ONFIDO_TOKEN, ONYXKEYS.ONFIDO_APPLICANT_ID, -]; +]); -// eslint-disable-next-line unicorn/prefer-set-has -const keysToMask = [ +const keysToMask = new Set([ 'addressCity', 'addressName', 'addressStreet', @@ -130,13 +128,11 @@ const keysToMask = [ 'validateCode', 'zip', 'zipCode', -]; +]); -// eslint-disable-next-line unicorn/prefer-set-has -const amountKeysToRandomize = ['amount', 'modifiedAmount', 'originalAmount', 'total', 'unheldTotal', 'unheldNonReimbursableTotal', 'nonReimbursableTotal']; +const amountKeysToRandomize = new Set(['amount', 'modifiedAmount', 'originalAmount', 'total', 'unheldTotal', 'unheldNonReimbursableTotal', 'nonReimbursableTotal']); -// eslint-disable-next-line unicorn/prefer-set-has -const nodesToFullyMask = ['reservationList']; +const nodesToFullyMask = new Set(['reservationList']); const emailRegex = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/; @@ -299,7 +295,7 @@ const maskFragileData = (data: OnyxState | unknown[] | null, emailMap: Map MASKING_PATTERN); } else if (typeof value === 'object') { @@ -344,7 +340,7 @@ const removePrivateOnyxKeys = (onyxState: OnyxState): OnyxState => { const newState: OnyxState = {}; Object.keys(onyxState).forEach((key) => { - if (onyxKeysToRemove.includes(key as ValueOf)) { + if (onyxKeysToRemove.has(key as ValueOf)) { return; } newState[key] = onyxState[key]; diff --git a/src/libs/Navigation/AppNavigator/createSplitNavigator/usePreserveNavigatorState.ts b/src/libs/Navigation/AppNavigator/createSplitNavigator/usePreserveNavigatorState.ts index a234b530a49f..4836ab2f8464 100644 --- a/src/libs/Navigation/AppNavigator/createSplitNavigator/usePreserveNavigatorState.ts +++ b/src/libs/Navigation/AppNavigator/createSplitNavigator/usePreserveNavigatorState.ts @@ -4,11 +4,10 @@ import {useEffect} from 'react'; const preservedNavigatorStates: Record> = {}; const cleanPreservedNavigatorStates = (state: NavigationState) => { - // eslint-disable-next-line unicorn/prefer-set-has - const currentSplitNavigatorKeys = state.routes.map((route) => route.key); + const currentSplitNavigatorKeys = new Set(state.routes.map((route) => route.key)); for (const key of Object.keys(preservedNavigatorStates)) { - if (!currentSplitNavigatorKeys.includes(key)) { + if (!currentSplitNavigatorKeys.has(key)) { delete preservedNavigatorStates[key]; } } diff --git a/src/libs/PerDiemRequestUtils.ts b/src/libs/PerDiemRequestUtils.ts index 8749a00a68bf..bef97eb78706 100644 --- a/src/libs/PerDiemRequestUtils.ts +++ b/src/libs/PerDiemRequestUtils.ts @@ -129,11 +129,10 @@ function getDestinationListSections({ }); } - // eslint-disable-next-line unicorn/prefer-set-has - const selectedOptionRateIDs = selectedOptions.map((selectedOption) => selectedOption.rateID); + const selectedOptionRateIDs = new Set(selectedOptions.map((selectedOption) => selectedOption.rateID)); if (sortedDestinations.length < CONST.STANDARD_LIST_ITEM_LIMIT) { - const filteredNonSelectedDestinations = sortedDestinations.filter(({rateID}) => !selectedOptionRateIDs.includes(rateID)); + const filteredNonSelectedDestinations = sortedDestinations.filter(({rateID}) => !selectedOptionRateIDs.has(rateID)); if (filteredNonSelectedDestinations.length === 0) { return destinationSections; } @@ -149,7 +148,7 @@ function getDestinationListSections({ return destinationSections; } - const filteredRecentlyUsedDestinations = sortedDestinations.filter(({rateID}) => recentlyUsedDestinations.includes(rateID) && !selectedOptionRateIDs.includes(rateID)); + const filteredRecentlyUsedDestinations = sortedDestinations.filter(({rateID}) => recentlyUsedDestinations.includes(rateID) && !selectedOptionRateIDs.has(rateID)); if (filteredRecentlyUsedDestinations.length > 0) { const cutRecentlyUsedDestinations = filteredRecentlyUsedDestinations.slice(0, maxRecentReportsToShow); diff --git a/src/libs/PolicyDistanceRatesUtils.ts b/src/libs/PolicyDistanceRatesUtils.ts index eef27ee44aa3..6216f09616a0 100644 --- a/src/libs/PolicyDistanceRatesUtils.ts +++ b/src/libs/PolicyDistanceRatesUtils.ts @@ -70,11 +70,10 @@ function buildOnyxDataForPolicyDistanceRateUpdates(policyID: string, customUnit: const optimisticRates: Record> = {}; const successRates: Record> = {}; const failureRates: Record> = {}; - // eslint-disable-next-line unicorn/prefer-set-has - const rateIDs = customUnitRates.map((rate) => rate.customUnitRateID); + const rateIDs = new Set(customUnitRates.map((rate) => rate.customUnitRateID)); for (const rateID of Object.keys(customUnit.rates)) { - if (rateIDs.includes(rateID)) { + if (rateIDs.has(rateID)) { const foundRate = customUnitRates.find((rate) => rate.customUnitRateID === rateID); optimisticRates[rateID] = { ...foundRate, diff --git a/src/libs/SelectionScraper/index.ts b/src/libs/SelectionScraper/index.ts index 09ca9c999e39..7dc1bf6a99f8 100644 --- a/src/libs/SelectionScraper/index.ts +++ b/src/libs/SelectionScraper/index.ts @@ -6,8 +6,7 @@ import {parseDocument} from 'htmlparser2'; import CONST from '@src/CONST'; import type GetCurrentSelection from './types'; -// eslint-disable-next-line unicorn/prefer-set-has -const markdownElements = ['h1', 'strong', 'em', 'del', 'blockquote', 'q', 'code', 'pre', 'a', 'br', 'li', 'ul', 'ol', 'b', 'i', 's', 'mention-user']; +const markdownElements = new Set(['h1', 'strong', 'em', 'del', 'blockquote', 'q', 'code', 'pre', 'a', 'br', 'li', 'ul', 'ol', 'b', 'i', 's', 'mention-user']); const tagAttribute = 'data-testid'; /** @@ -121,7 +120,7 @@ const replaceNodes = (dom: ChildNode, isChildOfEditorElement: boolean): ChildNod const child = dom.children.at(0); if (dom.attribs?.[tagAttribute]) { // If it's a markdown element, rename it according to the value of data-testid, so ExpensiMark can parse it - if (markdownElements.includes(dom.attribs[tagAttribute])) { + if (markdownElements.has(dom.attribs[tagAttribute])) { domName = dom.attribs[tagAttribute]; } } else if (dom.name === 'div' && dom.children.length === 1 && isChildOfEditorElement && child) { diff --git a/src/libs/TagsOptionsListUtils.ts b/src/libs/TagsOptionsListUtils.ts index 4b17c55d23ef..37ae88d97a15 100644 --- a/src/libs/TagsOptionsListUtils.ts +++ b/src/libs/TagsOptionsListUtils.ts @@ -69,17 +69,15 @@ function getTagListSections({ const tagSections = []; const sortedTags = sortTags(tags, localeCompare); - // eslint-disable-next-line unicorn/prefer-set-has - const selectedOptionNames = selectedOptions.map((selectedOption) => selectedOption.name); + const selectedOptionNames = new Set(selectedOptions.map((selectedOption) => selectedOption.name)); const enabledTags = sortedTags.filter((tag) => tag.enabled); - // eslint-disable-next-line unicorn/prefer-set-has - const enabledTagsNames = enabledTags.map((tag) => tag.name); - const enabledTagsWithoutSelectedOptions = enabledTags.filter((tag) => !selectedOptionNames.includes(tag.name)); + const enabledTagsNames = new Set(enabledTags.map((tag) => tag.name)); + const enabledTagsWithoutSelectedOptions = enabledTags.filter((tag) => !selectedOptionNames.has(tag.name)); const selectedTagsWithDisabledState: SelectedTagOption[] = []; const numberOfTags = enabledTags.length; selectedOptions.forEach((tag) => { - if (enabledTagsNames.includes(tag.name)) { + if (enabledTagsNames.has(tag.name)) { selectedTagsWithDisabledState.push({...tag, enabled: true}); return; } @@ -128,7 +126,7 @@ function getTagListSections({ const filteredRecentlyUsedTags = recentlyUsedTags .filter((recentlyUsedTag) => { const tagObject = sortedTags.find((tag) => tag.name === recentlyUsedTag); - return !!tagObject?.enabled && !selectedOptionNames.includes(recentlyUsedTag) && tagObject?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; + return !!tagObject?.enabled && !selectedOptionNames.has(recentlyUsedTag) && tagObject?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; }) .map((tag) => ({name: tag, enabled: true})); diff --git a/src/libs/TaxOptionsListUtils.ts b/src/libs/TaxOptionsListUtils.ts index 828ff85f584c..82bbbabf3519 100644 --- a/src/libs/TaxOptionsListUtils.ts +++ b/src/libs/TaxOptionsListUtils.ts @@ -74,17 +74,15 @@ function getTaxRatesSection({ const taxes = transformedTaxRates(policy, transaction); const sortedTaxRates = sortTaxRates(taxes, localeCompare); - // eslint-disable-next-line unicorn/prefer-set-has - const selectedOptionNames = selectedOptions.map((selectedOption) => selectedOption.modifiedName); + const selectedOptionNames = new Set(selectedOptions.map((selectedOption) => selectedOption.modifiedName)); const enabledTaxRates = sortedTaxRates.filter((taxRate) => !taxRate.isDisabled); - // eslint-disable-next-line unicorn/prefer-set-has - const enabledTaxRatesNames = enabledTaxRates.map((tax) => tax.modifiedName); - const enabledTaxRatesWithoutSelectedOptions = enabledTaxRates.filter((tax) => tax.modifiedName && !selectedOptionNames.includes(tax.modifiedName)); + const enabledTaxRatesNames = new Set(enabledTaxRates.map((tax) => tax.modifiedName)); + const enabledTaxRatesWithoutSelectedOptions = enabledTaxRates.filter((tax) => tax.modifiedName && !selectedOptionNames.has(tax.modifiedName)); const selectedTaxRateWithDisabledState: Tax[] = []; const numberOfTaxRates = enabledTaxRates.length; selectedOptions.forEach((tax) => { - if (enabledTaxRatesNames.includes(tax.modifiedName)) { + if (enabledTaxRatesNames.has(tax.modifiedName)) { selectedTaxRateWithDisabledState.push({...tax, isDisabled: false, isSelected: true}); return; } diff --git a/src/libs/actions/Policy/DistanceRate.ts b/src/libs/actions/Policy/DistanceRate.ts index 065df98f7531..6f3d1c5be251 100644 --- a/src/libs/actions/Policy/DistanceRate.ts +++ b/src/libs/actions/Policy/DistanceRate.ts @@ -324,11 +324,10 @@ function setPolicyDistanceRatesEnabled(policyID: string, customUnit: CustomUnit, const optimisticRates: Record> = {}; const successRates: Record> = {}; const failureRates: Record> = {}; - // eslint-disable-next-line unicorn/prefer-set-has - const rateIDs = customUnitRates.map((rate) => rate.customUnitRateID); + const rateIDs = new Set(customUnitRates.map((rate) => rate.customUnitRateID)); for (const rateID of Object.keys(currentRates)) { - if (rateIDs.includes(rateID)) { + if (rateIDs.has(rateID)) { const foundRate = customUnitRates.find((rate) => rate.customUnitRateID === rateID); optimisticRates[rateID] = {...foundRate, pendingFields: {enabled: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}}; successRates[rateID] = {...foundRate, pendingFields: {enabled: null}}; diff --git a/src/libs/requireParameters.ts b/src/libs/requireParameters.ts index 46d74bc44bf8..8fd6efe43dc3 100644 --- a/src/libs/requireParameters.ts +++ b/src/libs/requireParameters.ts @@ -11,11 +11,10 @@ export default function requireParameters(parameterNames: string[], parameters: return; } - // eslint-disable-next-line unicorn/prefer-set-has - const propertiesToRedact = ['authToken', 'password', 'partnerUserSecret', 'twoFactorAuthCode']; + const propertiesToRedact = new Set(['authToken', 'password', 'partnerUserSecret', 'twoFactorAuthCode']); const parametersCopy = {...parameters}; Object.keys(parametersCopy).forEach((key) => { - if (!propertiesToRedact.includes(key.toString())) { + if (!propertiesToRedact.has(key.toString())) { return; } diff --git a/src/pages/RoomInvitePage.tsx b/src/pages/RoomInvitePage.tsx index 030c539f78fd..180c238f8a34 100644 --- a/src/pages/RoomInvitePage.tsx +++ b/src/pages/RoomInvitePage.tsx @@ -147,11 +147,10 @@ function RoomInvitePage({ }); // Filtering out selected users from the search results - // eslint-disable-next-line unicorn/prefer-set-has - const selectedLogins = selectedOptions.map(({login}) => login); - const personalDetailsWithoutSelected = personalDetails ? personalDetails.filter(({login}) => !selectedLogins.includes(login)) : []; + const selectedLogins = new Set(selectedOptions.map(({login}) => login)); + const personalDetailsWithoutSelected = personalDetails ? personalDetails.filter(({login}) => !selectedLogins.has(login)) : []; const personalDetailsFormatted = personalDetailsWithoutSelected.map((personalDetail) => formatMemberForList(personalDetail)); - const hasUnselectedUserToInvite = userToInvite && !selectedLogins.includes(userToInvite.login); + const hasUnselectedUserToInvite = userToInvite && !selectedLogins.has(userToInvite.login); sectionsArr.push({ title: translate('common.contacts'), diff --git a/src/pages/home/report/LinkPreviewer.tsx b/src/pages/home/report/LinkPreviewer.tsx index 6762963e7a8e..e80c8cbb1599 100644 --- a/src/pages/home/report/LinkPreviewer.tsx +++ b/src/pages/home/report/LinkPreviewer.tsx @@ -8,8 +8,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import variables from '@styles/variables'; import type {LinkMetadata} from '@src/types/onyx/ReportAction'; -// eslint-disable-next-line unicorn/prefer-set-has -const IMAGE_TYPES = ['jpg', 'jpeg', 'png']; +const IMAGE_TYPES = new Set(['jpg', 'jpeg', 'png']); const MAX_IMAGE_HEIGHT = 180; const MAX_IMAGE_WIDTH = 340; @@ -80,7 +79,7 @@ function LinkPreviewer({linkMetadata = [], maxAmountOfPreviews = -1}: LinkPrevie )} {!!description && {description}} - {!!image?.type && IMAGE_TYPES.includes(image.type) && !!image.width && !!image.height && ( + {!!image?.type && IMAGE_TYPES.has(image.type) && !!image.width && !!image.height && ( (transaction?.splitShares?.[Number(accountID)]?.amount ?? 0) > 0) - .map((accountID) => Number(accountID)); + const participantsWithAmount = new Set( + Object.keys(transaction.splitShares ?? {}) + .filter((accountID: string): boolean => (transaction?.splitShares?.[Number(accountID)]?.amount ?? 0) > 0) + .map((accountID) => Number(accountID)), + ); splitParticipants = selectedParticipants.filter((participant) => - participantsWithAmount.includes( + participantsWithAmount.has( participant.isPolicyExpenseChat ? (participant?.ownerAccountID ?? CONST.DEFAULT_NUMBER_ID) : (participant.accountID ?? CONST.DEFAULT_NUMBER_ID), ), ); diff --git a/src/pages/workspace/receiptPartners/InviteReceiptPartnerPolicyPage.tsx b/src/pages/workspace/receiptPartners/InviteReceiptPartnerPolicyPage.tsx index 9b65f8404037..157de040974a 100644 --- a/src/pages/workspace/receiptPartners/InviteReceiptPartnerPolicyPage.tsx +++ b/src/pages/workspace/receiptPartners/InviteReceiptPartnerPolicyPage.tsx @@ -120,9 +120,8 @@ function InviteReceiptPartnerPolicyPage({route}: InviteReceiptPartnerPolicyPageP } // Combine selected members with unselected members - // eslint-disable-next-line unicorn/prefer-set-has - const selectedLogins = selectedOptions.map(({login}) => login); - const unselectedMembers = membersToDisplay.filter(({login}) => !selectedLogins.includes(login)); + const selectedLogins = new Set(selectedOptions.map(({login}) => login)); + const unselectedMembers = membersToDisplay.filter(({login}) => !selectedLogins.has(login)); const allMembersWithState: MemberForList[] = []; filterSelectedOptions.forEach((member) => { diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index 9af99a1e8187..31f4e4341dd7 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -752,9 +752,8 @@ function getVerticalPaddingDiffFromStyle(textInputContainerStyles: ViewStyle): n * Checks to see if the iOS device has safe areas or not */ function hasSafeAreas(windowWidth: number, windowHeight: number): boolean { - // eslint-disable-next-line unicorn/prefer-set-has - const heightsIPhonesWithNotches = [812, 896, 844, 926]; - return heightsIPhonesWithNotches.includes(windowHeight) || heightsIPhonesWithNotches.includes(windowWidth); + const heightsIPhonesWithNotches = new Set([812, 896, 844, 926]); + return heightsIPhonesWithNotches.has(windowHeight) || heightsIPhonesWithNotches.has(windowWidth); } /** diff --git a/tests/unit/OptionsListUtilsTest.tsx b/tests/unit/OptionsListUtilsTest.tsx index 10d1e19b6fb7..6ac5a3cf58b2 100644 --- a/tests/unit/OptionsListUtilsTest.tsx +++ b/tests/unit/OptionsListUtilsTest.tsx @@ -1065,9 +1065,8 @@ describe('OptionsListUtils', () => { // Given a set of reports and personalDetails // When we call getValidOptions with no search value const results = getValidOptions({reports: OPTIONS.reports, personalDetails: OPTIONS.personalDetails}, {}, nvpDismissedProductTraining); - // eslint-disable-next-line unicorn/prefer-set-has - const reportLogins = results.recentReports.map((reportOption) => reportOption.login); - const personalDetailsOverlapWithReports = results.personalDetails.every((personalDetailOption) => reportLogins.includes(personalDetailOption.login)); + const reportLogins = new Set(results.recentReports.map((reportOption) => reportOption.login)); + const personalDetailsOverlapWithReports = results.personalDetails.every((personalDetailOption) => reportLogins.has(personalDetailOption.login)); // Then we should expect all the personalDetails to show except the currently logged in user expect(results.personalDetails.length).toBe(Object.values(OPTIONS.personalDetails).length - 1);