[No QA] 81443: Reduce cont of Eslint issues from 399 to 378#81588
[No QA] 81443: Reduce cont of Eslint issues from 399 to 378#81588neil-marcellini merged 9 commits intoExpensify:mainfrom
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@neil-marcellini We can mark this as No QA. |
src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 840fde7f94
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const transactionIDSet = useMemo(() => { | ||
| const set = new Set<string>(); | ||
| for (const report of reportsToArchive) { | ||
| if (!report?.iouReportID) { | ||
| continue; | ||
| } | ||
| const reportTransactions = getReportTransactions(report.iouReportID); | ||
| for (const transaction of reportTransactions) { | ||
| set.add(transaction.transactionID); | ||
| } | ||
| } | ||
| } | ||
| return set; | ||
| }, [reportsToArchive]); |
There was a problem hiding this comment.
Recompute transaction ID set when transactions change
Because transactionIDSet is now memoized only on reportsToArchive, it won’t update when the transactions for those reports change. If a new transaction (with a violation) is added to an existing report, useOnyx(TRANSACTION_VIOLATIONS) will re-render due to the new violation but transactionIDSet stays stale and filters it out, so the hook can miss violations for newly added transactions. Previously, the set was rebuilt on every render and picked up the latest getReportTransactions data. Consider including a dependency that changes when report transactions update, or avoid memoizing this set.
Useful? React with 👍 / 👎.
|
@abbasifaizan70 Were you able to build it native without problems? I'm getting errors. |
|
No product review needed |
Co-authored-by: Cursor <cursoragent@cursor.com>
@brunovjk I just merged main and then clear old cache built |
neil-marcellini
left a comment
There was a problem hiding this comment.
(Neil's AI agent) Good batch of ESLint warning fixes. All changes follow standard patterns:
Onyx.connect→Onyx.connectWithoutView(deprecation)useMemo/useCallbackwrappers for hook dependency warnings- Deriving state from props instead of
useEffectsync in the company card components - Missing useMemo dependencies added
- Relative import path fix
Neil
Please respond to all of the AI review comments and say whether you will fix them with a suggestion or explain why the comment is invalid.
For changes to Onyx Connect without view, we need to make sure that we follow the existing guidelines for that function. It is not proper to replace Onyx.connect to Onyx.connectWithoutView for a lot of cases. Instead, I would rather silence the ESLint warning for the call to Onyx.connect because it will eventually be refactored. Here's the main tracking issue https://github.com/Expensify/Expensify/issues/507850, but unfortunately it's internal only.
Guidance:
data will need to be accessed from the UI view using useOnyx() (or have a new hook created for this piece of data) and passed to the library methods as parameters.
src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx
Outdated
Show resolved
Hide resolved
|
@neil-marcellini Can you take a look? Thanks |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
neil-marcellini
left a comment
There was a problem hiding this comment.
(Neil's AI agent)
Thanks for addressing the feedback! Most changes look good now:
- CurrencyUtils.ts lint ignore — correct
- report?.currency fix in MoneyRequestReportTransactionList — correct
- allTransactions added to transactionIDSet useMemo deps — correct
However, LocalePhoneNumber.ts still uses Onyx.connectWithoutView instead of a lint ignore comment. Please change these the same way you fixed CurrencyUtils.ts — keep Onyx.connect and add the eslint-disable comment:
neil-marcellini
left a comment
There was a problem hiding this comment.
we need to fix the allTransactions thing
neil-marcellini
left a comment
There was a problem hiding this comment.
It doesn't seem like the eslint-disable comments are working to ignore the errors, and last I ran this we still have a lot of warnings.
✖ 423 problems (19 errors, 404 warnings)
5 errors and 0 warnings potentially fixable with the `--fix` option.
✔ Lint done.
➜ App (81443)
However it's an incremental improvement and I'm happy with that.
| return groupTransactionsByCategory(sortedTransactions, report, localeCompare); | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [sortedTransactions, currentGroupBy, report?.reportID, localeCompare, shouldShowGroupedTransactions]); | ||
| }, [sortedTransactions, currentGroupBy, report?.reportID, report?.currency, localeCompare, shouldShowGroupedTransactions]); |
There was a problem hiding this comment.
This didn't work, there's still a warning here.
|
|
||
| let currencyList: OnyxValues[typeof ONYXKEYS.CURRENCY_LIST] = {}; | ||
|
|
||
| /* eslint-disable rulesdir/prefer-onyx-connect-in-libs -- may refactor to useOnyx/connectWithoutView later */ |
There was a problem hiding this comment.
This doesn't work to ignore the warnings.
| import {parsePhoneNumber} from './PhoneNumber'; | ||
|
|
||
| let countryCodeByIPOnyx: number; | ||
| // eslint-disable-next-line rulesdir/prefer-onyx-connect-in-libs -- may refactor to useOnyx/connectWithoutView later |
|
No checklist needed for this. The behavior should be the same and if there are regressions, we should be able to catch them in staging. |
|
🚧 @neil-marcellini has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.3.17-0 🚀
|
|
Thank you for handling this @neil-marcellini |
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.17-9 🚀
|


Explanation of Change
This PR will reduce Lint warnings from 399 to 375
Fixed Issues
$ #81443
PROPOSAL: #81443 (comment)
Tests
No QA.
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari