Repository navigation
Description
Background
While preparing the ESLint to Oxlint migration, a batch of violations surfaced that ESLint does not report
today. import/no-cycle is the largest of them by a wide margin: 534 circular imports across 148 files
in src/, all of them real.
The rule has been in our ESLint config for years with maxDepth: '∞', and it reports 0. ESLint's
resolver never resolves the @src/..., @libs/... and @components/... aliases, so it never builds a
module graph and has nothing to check. Oxlint reads tsconfig.json, resolves the aliases, and sees the
graph.
Fixing what the new linter found is a prerequisite for the migration. The day Oxlint becomes a blocking
check, these 534 findings become 534 hard errors, so the cleanup has to land first and on its own schedule.
Cycle path is a symptom, not a work item. Break the cycle it draws and the finding often
survives, now drawing a different cycle through the same import. One row fixed can reappear as another cycle issue re-reported.
The numbers
| Findings | 534 |
| Files involved | 148, all under src/ |
| Mutually dependent clusters | 6, largest 116 files |
| Import edges inside those clusters | 537 |
| Import edges that must break to reach 0 findings | 54 |
| Shortest and longest cycle | 2 and 39 modules |
Definition of done
- A clean Oxlint run reports 0
import/no-cyclefindings. - No
eslint-disableoroxlint-disablecomment is added forimport/no-cycleanywhere. A suppressed cycle
is still a cycle and still carries costs.
How to validate numbers
List generated on POC oxlint branch #98027
To reproduce use .oxlintrc.no-cycle.json and run command:
npx oxlint . -c .oxlintrc.no-cycle.json -f json > oxlint-no-cycle-findings.json
Current results:
oxlint-no-cycle-findings.json
Activity
LukasMod commentedon Aug 27, 2026
@MelvinBot assign @roryabraham and @LukasMod here
MelvinBot commentedon Aug 27, 2026
🤖 Done — assigned
roryabrahamandLukasModto this issue.view run
LukasMod commentedon Aug 28, 2026
1 PR: #99670 is ready for review: 534 findings reduced to 478 (-56)
thelullabyy commentedon Aug 30, 2026
@roryabraham @LukasMod Since I reviewed the first PR, could you please assign me the assign so that I will be assigned on the part 2 PR?
LukasMod commentedon Aug 31, 2026
@thelullabyy Sorry but I don't have such permissions to assign someone. Lets wait for @roryabraham to decide that.
In a meantime I prepared PR2: #99768 478 -> 458 (-20)
roryabraham commentedon Aug 31, 2026
PR 1 merged. Requested @thelullabyy review on parts 2 and 3
122 remaining items
melvin-bot commentedon Nov 9, 2026
@thelullabyy Whoops! This issue is 2 days overdue. Let's get this updated quick!
roryabraham commentedon Nov 9, 2026
@MelvinBot inventory what we have left to do here
MelvinBot commentedon Nov 9, 2026
Remaining inventory
The review queue is clear: parts 1–22 are merged. Part 22 merged today. I found no PRs for parts 23–25.
Current main’s seatbelt records 32
import/no-cyclefindings across 14 files:These are baseline allowances, not a fresh lint measurement or 32 independent fixes.
Work left
pressLockedBankAccountfrom BankAccounts; pass bank-account data explicitly.Skip Paymentremains set per the consolidation decision.Already done: Oxlint is now the blocking linter through the migration PR, so adding the guardrail is no longer outstanding. The immediate next action is the post-part-22 analysis, not another review round.
view run
LukasMod commentedon Nov 10, 2026
I'm working on an updated plan based on the current repo state, as some things have already changed. At the moment, we have 39 issues left (32 if we exclude the ones with
eslint-disable).Also, I'll be OOO on November 11 due to a national public holiday.
bankAccountListinstead of importing the BankAccounts actionreportTransactionsinstead of importing TransactionUtilsTransactionUtils/violations.tsout of the loopPR details
PR 1: TransactionUtils leaf helpers (-12)
TransactionUtils/index.tsinto leaf files that import nothing from the loop, and point the sub-files at them instead of./index.TransactionUtils/tagArray.ts(getTagArrayFromName), used byPolicyUtils/tag.tsandbuildOptimisticTransaction.ts.getAmount,getCurrency,getMerchant,getTag,getCategory,isScanRequest, ...) moved intoTransactionUtils/fields.ts;index.tsre-exports them, so outside callers do not change.ReportStateUtils.tswithisOpenReport/isProcessingReport(stateNum/statusNum checks); ReportUtils imports and re-exports them.tax.ts,duplicates.ts,getUpdatedTransaction.tsandReportNameUtils.tsimport from the leaves and from PolicyUtils sub-files instead of the barrels. Obsolete disable comments removed.eslint-disablethat stays inTransactionUtils/index.tsuntil PR 4, and tidy two comments infields.ts.PR 2: bank account list as a parameter (-5)
PolicyUtils/members.tsandReportUtils.getReportPreviewMessageread the bank account from abankAccountListparameter instead ofgetBankAccountFromIDinactions/BankAccounts.getEligibleBankAccountShareRecipientEmails/hasEligibleBankAccountShareRecipienttakebankAccountList;ShareBankAccount.tsxandWalletPagepassuseOnyx(ONYXKEYS.BANK_ACCOUNT_LIST).getReportPreviewMessagereadsbankAccountList?.[bankAccountID]. To keep every path correct,bankAccountListis also threaded throughOptionsListUtils(GetAlternateTextConfig,getSearchOptions,getValidOptions) fromSearchAutocompleteList,useAutocompleteSuggestionsanduseSearchSelector/base(one newuseOnyxthere).bankAccountListand gotundefinedon the Search path, now gets the real list too.useOnyxinShareBankAccount.tsx.PR 3: approvals take report transactions (-7, needs PR 1)
PolicyUtils/approvals.tsstops callinggetAllSortedTransactions(reportID);getRuleApprovers,getFirstRuleApprover,getSubmitToEmail,getSubmitToAccountIDandgetSubmitReportManagerAccountIDtakereportTransactions.actions/Report,actions/Search,ReportWorkflow,useReportSubmitToPopover, plusPolicyUtilsTestand the perf-local test.SearchUIUtilspasses only the row's transaction (or Search snapshot transactions), so a rule approver tied to another expense on the report can be missed, which can change whether APPROVE shows.nonPendingDeleteTransactions, which changes which expenses pick the approver.PR 4: duplicates no longer re-exported from the barrel (-2, needs PR 1)
TransactionUtils/index.tsstops re-exporting the 6 duplicate-expense helpers; consumers import from@libs/TransactionUtils/duplicates.DynamicReview*Page,DynamicConfirmationPage,MoneyRequestHeaderPrimaryAction,TransactionPreview,TransactionPreviewUtils, IOU actions) and 2 test files. This also clearsduplicates.ts -> ReportUtils.PR 5:
TransactionUtils/violations.tsout of the loop (-3, needs PR 1)violations.tsimports only fromfields.tsandReportStateUtils.ts.isIOUReport,isInvoiceReport,isOpenExpenseReport,isSettled,isCurrentUserSubmitterandisReportManagermove toReportStateUtils.ts. ReportUtils keeps same-name wrappers, so its roughly 100 importers do not change.isCategoryBeingAnalyzed/isMerchantMissingmove tofields.ts;hasPendingUI/isTransactionSubmittablemove toindex.ts.shouldShowBrokenConnectionViolationtakescurrentUserAccountID; its 5 component callers andReportPrimaryActionUtilsalready have the value.fields.tsheader comment and typecurrentUserAccountIDasnumber.PR 6: ReportActionsUtils stops importing ReportUtils (-3)
doesReportContainRequestsFromMultipleUsers.ts.hasRequestFromCurrentAccounttakesreportTransactions; its 7 callers pass it (4 adduseReportTransactions).isReportActionVisiblereads a report-ID set thatParser.tsbuilds inside its existingOnyx.connectcallback. No new subscription.SettlementButtonadds auseReportTransactionsper Search row (a perf note, not a rule violation).Parser.tsan acceptable home for the support-ticket set?PR 7: ReportUtils stops importing ViolationsUtils (-3, needs PR 1)
hasVisibleViolationsForUserin where ReportUtils needs it.pushTransactionViolationsOnyxData,pushTransactionAutoSelectionsOnyxDataand their helpers move verbatim to a newsrc/libs/Violations/policyViolationUpdates.ts; 12 call sites repointed.getViolatingReportIDForRBRInLHN,hasReportErrorsOtherThanFailedReceiptandgenerateReportAttributestakehasVisibleViolationsForUseras a required callback; 6 production callers pass the real function.PR 8: ReportUtils stops importing ReportNameUtils (-2)
getReportNameto a leaf and passes the three name generators in as parameters.src/libs/getReportName.ts; ReportNameUtils re-exports it, so its roughly 45 callers do not change.getIcons(viaGetIconsParams) takesgetGroupChatName;getParentNavigationSubtitletakesgetInvoicePayerName;getChatListItemReportNametakesgetInvoiceReportName. 12 production and about 40 test call sites updated.getReportName.tsback above the function, and say the "injected to avoid the cycle" comment once instead of 4 times. Same design concern as PR 7.getIconsand friends out of ReportUtils into their own module. That avoids callbacks but repoints every importer ofgetIcons(a re-export from ReportUtils would bring the loop back).PR 9: TransactionUtils/index stops importing ReportUtils (-2, last)
ReportUtils <-> TransactionUtils/index.ts.ReportUtils -> TransactionUtilshas hundreds of uses and cannot be cut, so TransactionUtils must drop its 5 ReportUtils imports.isThread,isIOUReport: use leaf versions inReportStateUtils.ts(isIOUReportarrives with PR 5).getReportTransactions,getReportOrDraftReport(read Onyx-backed state in ReportUtils): pass the data in from callers.getTransactionDetails: move it out of ReportUtils if its dependencies allow, otherwise pass in what it reads.melvin-bot commentedon Nov 11, 2026
@thelullabyy
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.35-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
LukasMod commentedon Nov 12, 2026
Part 23 is ready: #106716
It covers PR 1 and PR 4 from the plan, so it brings the count from 39 to 25. I left out the ReportStateUtils.ts leaf from PR 1 because the count is 25 without it. It can come back with PR 5 or 9 where violations.ts actually needs it.
LukasMod commentedon Nov 23, 2026
Part 24 is ready: #107381
It covers PR 5 from the plan
LukasMod commentedon Nov 27, 2026
Update, 2 waiting for review:
Part 24: #107381
Part 25 (new one): #108190 (covers PR 2 from the plan)