Fix useMemo lint warnings in QuickbooksLocationsDisplayedAsPage#83619
Merged
Fix useMemo lint warnings in QuickbooksLocationsDisplayedAsPage#83619
Conversation
Compute canImportLocationsAsTags() outside the useMemo so the boolean result can be used as a primitive dependency, matching the pattern already used in the sibling QuickbooksLocationsPage.tsx. This avoids depending on the entire qboConfig object and fixes both the react-hooks/exhaustive-deps and react-hooks/preserve-manual-memoization warnings introduced in #83416. Made-with: Cursor
3b9739b to
11136ad
Compare
50 tasks
68 tasks
Contributor
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
Contributor
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
Contributor
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Contributor
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.27-0 🚀
|
Contributor
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.27-8 🚀
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
PR #83416 added a
canImportLocationsAsTags(qboConfig)call inside auseMemoinQuickbooksLocationsDisplayedAsPage.tsx, but the dependency array still listed individualqboConfigproperties. Since the wholeqboConfigobject is passed to the function, ESLint flagged two warnings:qboConfigqboConfig) didn't match the manually specified granular propertiesThese 2 new warnings pushed the total count from 383 to 385, exceeding the
--max-warnings=383threshold and breaking lint CI on main.Fix: Compute
canImportLocationsAsTags(qboConfig)outside theuseMemoand use the boolean result as a primitive dependency — matching the pattern already used in the siblingQuickbooksLocationsPage.tsx. The dependency array is now[canUseTagsForLocations, qboConfig?.syncLocations, translate], where all deps are primitives.Fixed Issues
N/A - This is a lint fix for warnings introduced by #83416.
Tests
npx eslint src/pages/workspace/accounting/qbo/import/QuickbooksLocationsDisplayedAsPage.tsxand verify 0 warningsnpm run lintand verify warnings are at or under the 383 thresholdLint output after fix:
383 warnings is at the
--max-warnings=383threshold (passes). The 16 errors are pre-existing onmainand unrelated to this change.Offline tests
N/A - This is a dependency array change only, no behavioral change.
QA Steps
[No QA] - This is a lint-only fix with no behavioral change.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
N/A - Lint-only fix, no UI changes