Skip to content

Commit a5e8ba6

Browse files
authored
Merge pull request Expensify#67708 from shubham1206agra/fix-eslint-1
[NoQA] Fix ESLint warning and update the max number
2 parents e48373d + c2cfc9d commit a5e8ba6

5 files changed

Lines changed: 20 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand",
4747
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
4848
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
49-
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=327 --cache --cache-location=node_modules/.cache/eslint",
49+
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=320 --cache --cache-location=node_modules/.cache/eslint",
5050
"lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh",
5151
"lint-watch": "npx eslint-watch --watch --changed",
5252
"shellcheck": "./scripts/shellCheck.sh",

src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,18 @@ function AttachmentPickerWithMenuItems({
233233
const moneyRequestOptionsList = temporary_getMoneyRequestOptions(report, policy, reportParticipantIDs ?? []).map((option) => options[option], isReportArchived);
234234

235235
return moneyRequestOptionsList.flat().filter((item, index, self) => index === self.findIndex((t) => t.text === item.text));
236-
}, [translate, shouldUseNarrowLayout, report, policy, reportParticipantIDs, selectOption, isDelegateAccessRestricted, showDelegateNoAccessModal, isManualDistanceTrackingEnabled]);
236+
}, [
237+
translate,
238+
shouldUseNarrowLayout,
239+
report,
240+
policy,
241+
reportParticipantIDs,
242+
selectOption,
243+
isDelegateAccessRestricted,
244+
showDelegateNoAccessModal,
245+
isManualDistanceTrackingEnabled,
246+
isReportArchived,
247+
]);
237248

238249
const createReportOption: PopoverMenuItem[] = useMemo(() => {
239250
if (!isPolicyExpenseChat(report) || !isPaidGroupPolicy(report) || !isReportOwner(report)) {

src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ function ReportActionCompose({
244244
const parentReport = getParentReport(report);
245245
const isSettledOrApproved = isSettled(report) || isSettled(parentReport) || isReportApproved({report}) || isReportApproved({report: parentReport});
246246
return (shouldAddOrReplaceReceipt && !isSettledOrApproved) || !!temporary_getMoneyRequestOptions(report, policy, reportParticipantIDs, isReportArchived).length;
247-
}, [shouldAddOrReplaceReceipt, report, policy, reportParticipantIDs]);
247+
}, [shouldAddOrReplaceReceipt, report, policy, reportParticipantIDs, isReportArchived]);
248248

249249
// Placeholder to display in the chat input.
250250
const inputPlaceholder = useMemo(() => {

src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu, isT
129129
const [travelSettings] = useOnyx(ONYXKEYS.NVP_TRAVEL_SETTINGS, {canBeMissing: true});
130130

131131
const canSendInvoice = useMemo(() => canSendInvoicePolicyUtils(allPolicies as OnyxCollection<OnyxTypes.Policy>, session?.email), [allPolicies, session?.email]);
132-
const isArchivedReport = useReportIsArchived(quickActionReport?.reportID);
133-
const isValidReport = !(isEmptyObject(quickActionReport) || isArchivedReport);
132+
const isValidReport = !(isEmptyObject(quickActionReport) || isReportArchived);
134133
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {canBeMissing: true});
135134
const [hasSeenTour = false] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {
136135
selector: hasSeenTourSelector,
@@ -155,16 +154,16 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu, isT
155154

156155
const quickActionAvatars = useMemo(() => {
157156
if (isValidReport) {
158-
const avatars = getIcons(quickActionReport, personalDetails, null, undefined, undefined, undefined, undefined, isArchivedReport);
157+
const avatars = getIcons(quickActionReport, personalDetails, null, undefined, undefined, undefined, undefined, isReportArchived);
159158
return avatars.length <= 1 || isPolicyExpenseChat(quickActionReport) ? avatars : avatars.filter((avatar) => avatar.id !== session?.accountID);
160159
}
161160
if (!isEmptyObject(policyChatForActivePolicy)) {
162-
return getIcons(policyChatForActivePolicy, personalDetails, null, undefined, undefined, undefined, undefined, isArchivedReport);
161+
return getIcons(policyChatForActivePolicy, personalDetails, null, undefined, undefined, undefined, undefined, isReportArchived);
163162
}
164163
return [];
165164
// Policy is needed as a dependency in order to update the shortcut details when the workspace changes
166165
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
167-
}, [personalDetails, session?.accountID, quickActionReport, quickActionPolicy, policyChatForActivePolicy]);
166+
}, [personalDetails, session?.accountID, quickActionReport, quickActionPolicy, policyChatForActivePolicy, isReportArchived, isValidReport]);
168167

169168
const quickActionTitle = useMemo(() => {
170169
if (isEmptyObject(quickActionReport)) {
@@ -397,6 +396,7 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu, isT
397396
shouldUseNarrowLayout,
398397
isDelegateAccessRestricted,
399398
showDelegateNoAccessModal,
399+
isReportArchived,
400400
]);
401401

402402
const isTravelEnabled = useMemo(() => {

src/pages/iou/request/MoneyRequestParticipantsSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ function MoneyRequestParticipantsSelector(
462462
const initiateContactImportAndSetState = useCallback(() => {
463463
setContactPermissionState(RESULTS.GRANTED);
464464
InteractionManager.runAfterInteractions(importAndSaveContacts);
465-
}, [importAndSaveContacts]);
465+
}, [importAndSaveContacts, setContactPermissionState]);
466466

467467
const footerContent = useMemo(() => {
468468
if (isDismissed && !shouldShowSplitBillErrorMessage && !participants.length) {

0 commit comments

Comments
 (0)