From efec85cf070a6a43256c6a23c3f8416789fecc14 Mon Sep 17 00:00:00 2001 From: rory Date: Fri, 1 May 2026 11:32:40 -0700 Subject: [PATCH 1/2] Allow __esModule in naming-convention rule, drop suppressions __esModule is a well-known bundler/Jest interop property. Add an explicit allow-list entry in the @typescript-eslint/naming-convention config so the double-underscore prefix no longer triggers the rule, then remove the 120+ eslint-disable-next-line comments that were papering over this. Co-authored-by: Cursor --- config/eslint/eslint.config.mjs | 10 ++++++++++ jest/setup.ts | 7 ------- .../hooks/useChartFontManager/useChartFontManager.ts | 1 - tests/actions/IOUTest.ts | 1 - tests/navigation/LinkedActionNotFoundGuardTest.tsx | 2 +- .../cleanStaleReportActionBackToParamTest.ts | 2 +- tests/navigation/isActiveRouteTests.tsx | 1 - tests/perf-test/SearchRouter.perf-test.tsx | 2 -- tests/perf-test/SelectionList.perf-test.tsx | 2 -- tests/perf-test/useAdvancedSearchFilters.perf-test.tsx | 1 - tests/ui/AuthScreensInitHandlerTest.tsx | 4 ---- tests/ui/AvatarSelector.test.tsx | 1 - tests/ui/ChronosTimerHeaderButton.test.tsx | 1 - tests/ui/FlightTripDetailsTest.tsx | 1 - tests/ui/GroupChatNameTests.tsx | 1 - tests/ui/IOURequestStepDistanceTest.tsx | 1 - tests/ui/MoneyRequestReportPreview.test.tsx | 1 - tests/ui/MultifactorAuthenticationRevokePageTest.tsx | 3 --- tests/ui/NewChatPageTest.tsx | 1 - tests/ui/ParentNavigationSubtitleTest.tsx | 1 - tests/ui/ReservationAddressTest.tsx | 1 - tests/ui/TestToolMenuBiometricsTest.tsx | 7 ------- tests/ui/components/DisplayNames.test.tsx | 2 -- tests/ui/components/IOURequestStepDistanceTest.tsx | 1 - tests/ui/components/LHNOptionsListTest.tsx | 1 - tests/ui/components/PopoverMenu.tsx | 2 -- tests/ui/components/ProductTrainingContextProvider.tsx | 1 - tests/ui/components/SearchAutocompleteListTest.tsx | 2 -- tests/ui/components/TimePickerTest.tsx | 1 - tests/unit/AgentZeroStatusContextTest.ts | 1 - tests/unit/ConfirmContentTest.tsx | 1 - tests/unit/ContextMenuActionsCopyMessageTest.ts | 2 -- tests/unit/EnvironmentContextTest.tsx | 1 - tests/unit/GoogleTagManagerTest.tsx | 1 - tests/unit/LightboxTest.tsx | 3 --- tests/unit/ReconnectTest.ts | 1 - tests/unit/RefreshCardFeedConnectionPageTest.tsx | 6 ------ tests/unit/Search/SearchListRenderCountTest.tsx | 4 ---- tests/unit/SearchAutocompleteListTest.tsx | 3 --- tests/unit/SettlementButtonUtilsTest.ts | 1 - tests/unit/TelemetrySynchronizerTest.ts | 1 - tests/unit/WhisperContentMentionContextTest.tsx | 1 - .../useNativeBiometricsHSM.test.ts | 3 --- tests/unit/generateTranslationsTest.ts | 1 - tests/unit/hooks/useActiveAdminPolicies.test.ts | 1 - tests/unit/hooks/useAdvancedSearchFilters.test.ts | 1 - tests/unit/hooks/useAutocompleteSuggestions.test.ts | 2 -- .../unit/hooks/useBiometricRegistrationStatusTest.tsx | 1 - tests/unit/hooks/useCopySelectionHelper.test.ts | 4 ---- tests/unit/hooks/useDistanceRequestState.test.ts | 1 - .../hooks/useExpensifyCardFeedsForFeedSelector.test.ts | 1 - tests/unit/hooks/useFreeTrial.test.ts | 1 - .../unit/hooks/useHasAnyAdminExpensifyCardFeed.test.ts | 1 - .../unit/hooks/useIsAllowedToIssueCompanyCard.test.ts | 2 -- tests/unit/hooks/useIsBlockedToAddFeed.test.ts | 1 - tests/unit/hooks/useLazyAsset.test.ts | 1 - tests/unit/hooks/useOtherFeedsForFeedSelector.test.tsx | 1 - tests/unit/hooks/useReceiptPreviewsSizes.test.ts | 1 - tests/unit/hooks/useReceiptScan.test.ts | 1 - .../hooks/useRestoreWorkspacesTabOnNavigate.test.ts | 1 - tests/unit/hooks/useSearchSections.test.ts | 5 ----- .../unit/hooks/useSearchShouldCalculateTotals.test.ts | 1 - .../unit/hooks/useSelectedTransactionsActions.test.ts | 1 - tests/unit/hooks/useSortedActiveAdminPolicies.test.ts | 2 -- tests/unit/hooks/useSplitParticipants.test.tsx | 2 -- tests/unit/hooks/useTaxAmount.test.ts | 1 - .../unit/hooks/useTimeSensitiveAddPaymentCard.test.ts | 1 - tests/unit/libs/getClipboardTextTest.ts | 1 - tests/unit/libs/prepareRequestPayloadNativeTest.ts | 3 --- tests/unit/libs/receiptDurableStorageTest.ts | 2 -- tests/unit/navigateAfterOnboardingTest.ts | 1 - tests/unit/navigateToWorkspacesPageTest.ts | 1 - tests/unit/reportAttributesTest.ts | 1 - tests/unit/showReportActionNotificationTest.ts | 3 --- tests/unit/useReportPreviewSenderIDTest.ts | 1 - tests/unit/useSearchSelectorTest.tsx | 1 - tests/unit/useTransactionViolationsTest.ts | 1 - 77 files changed, 12 insertions(+), 129 deletions(-) diff --git a/config/eslint/eslint.config.mjs b/config/eslint/eslint.config.mjs index 13a24d721720..558cde2f985b 100644 --- a/config/eslint/eslint.config.mjs +++ b/config/eslint/eslint.config.mjs @@ -269,6 +269,16 @@ const config = defineConfig([ '@typescript-eslint/max-params': ['error', {max: 10}], '@typescript-eslint/naming-convention': [ 'error', + { + selector: ['variable', 'property'], + format: null, + // Allow __esModule because it is a well-known interop property injected by bundlers + // (e.g. Babel/Webpack) and sometimes required by library internals (e.g. react-native-skia). + filter: { + regex: '^__esModule$', + match: true, + }, + }, { selector: ['variable', 'property'], format: ['camelCase', 'UPPER_CASE', 'PascalCase'], diff --git a/jest/setup.ts b/jest/setup.ts index d5782cc89189..dd72333af2ce 100644 --- a/jest/setup.ts +++ b/jest/setup.ts @@ -76,7 +76,6 @@ jest.mock('expo-location', () => ({ // Needed for: https://stackoverflow.com/questions/76903168/mocking-libraries-in-jest jest.mock('react-native/Libraries/LogBox/LogBox', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { ignoreLogs: jest.fn(), @@ -149,7 +148,6 @@ jest.mock('@libs/scheduleOnLiveMarkdownRuntime', () => { }); jest.mock('@src/setup/telemetry', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), navigationIntegration: { @@ -280,7 +278,6 @@ jest.mock( ); jest.mock('@libs/prepareRequestPayload/index.native.ts', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn((command: string, data: Record) => { const formData = new FormData(); @@ -303,7 +300,6 @@ jest.mock('@libs/prepareRequestPayload/index.native.ts', () => ({ jest.mock('@components/ConfirmedRoute.tsx'); jest.mock('@src/hooks/useWorkletStateMachine/runOnUISync', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => jest.fn()), // Return a function that returns a function })); @@ -367,17 +363,14 @@ jest.mock('@src/components/KeyboardDismissibleFlatList/KeyboardDismissibleFlatLi // in triggerUnreadUpdate (also timer-based), this creates excessive timer churn that causes // heavy integration tests like SessionTest to exceed their timeout. jest.mock('@src/hooks/useDocumentTitle', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), })); jest.mock('@src/hooks/useWorkspaceDocumentTitle', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), })); jest.mock('@src/hooks/useDomainDocumentTitle', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), })); diff --git a/src/components/Charts/hooks/useChartFontManager/useChartFontManager.ts b/src/components/Charts/hooks/useChartFontManager/useChartFontManager.ts index dae3919909d3..8e27d57a7c10 100644 --- a/src/components/Charts/hooks/useChartFontManager/useChartFontManager.ts +++ b/src/components/Charts/hooks/useChartFontManager/useChartFontManager.ts @@ -6,7 +6,6 @@ function webFont(url: string): DataModule { // a DataModule (i.e. the result of a dynamic `require()` call), which always has the shape // `{ __esModule: true, default: }`. The `__esModule` property uses a double-underscore prefix // that violates the naming-convention rule, but it is mandated by the library's internal contract. - // eslint-disable-next-line @typescript-eslint/naming-convention return {__esModule: true, default: url} as unknown as DataModule; } diff --git a/tests/actions/IOUTest.ts b/tests/actions/IOUTest.ts index 79ae8d23d49f..587ad1d03039 100644 --- a/tests/actions/IOUTest.ts +++ b/tests/actions/IOUTest.ts @@ -6764,7 +6764,6 @@ describe('actions/IOU', () => { describe('setMoneyRequestOdometerImage and removeMoneyRequestOdometerImage', () => { beforeEach(() => { jest.mock('@libs/OdometerImageUtils', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), })); diff --git a/tests/navigation/LinkedActionNotFoundGuardTest.tsx b/tests/navigation/LinkedActionNotFoundGuardTest.tsx index 78913ad0869c..12f692676f46 100644 --- a/tests/navigation/LinkedActionNotFoundGuardTest.tsx +++ b/tests/navigation/LinkedActionNotFoundGuardTest.tsx @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/naming-convention, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-assignment */ +/* eslint-disable @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-assignment */ import {act, render} from '@testing-library/react-native'; import React from 'react'; import {View} from 'react-native'; diff --git a/tests/navigation/cleanStaleReportActionBackToParamTest.ts b/tests/navigation/cleanStaleReportActionBackToParamTest.ts index f539734d4114..db44ac2958ab 100644 --- a/tests/navigation/cleanStaleReportActionBackToParamTest.ts +++ b/tests/navigation/cleanStaleReportActionBackToParamTest.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/naming-convention, @typescript-eslint/no-unsafe-return */ +/* eslint-disable @typescript-eslint/no-unsafe-return */ import type {NavigationState} from '@react-navigation/native'; import cleanStaleReportActionBackToParam from '@src/pages/inbox/cleanStaleReportActionBackToParam'; diff --git a/tests/navigation/isActiveRouteTests.tsx b/tests/navigation/isActiveRouteTests.tsx index a592eb7f6d33..609c8f8537b1 100644 --- a/tests/navigation/isActiveRouteTests.tsx +++ b/tests/navigation/isActiveRouteTests.tsx @@ -12,7 +12,6 @@ jest.mock('@libs/Navigation/navigationRef', () => { }; return { - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: navigationRefMock, }; diff --git a/tests/perf-test/SearchRouter.perf-test.tsx b/tests/perf-test/SearchRouter.perf-test.tsx index e270dcb302a0..efd1f199f0a9 100644 --- a/tests/perf-test/SearchRouter.perf-test.tsx +++ b/tests/perf-test/SearchRouter.perf-test.tsx @@ -46,13 +46,11 @@ jest.mock('@src/libs/Navigation/Navigation', () => ({ })); jest.mock('@src/hooks/useRootNavigationState', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({contextualReportID: undefined, isSearchRouterScreen: false}), })); jest.mock('@hooks/useExportedToFilterOptions', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ exportedToFilterOptions: [], diff --git a/tests/perf-test/SelectionList.perf-test.tsx b/tests/perf-test/SelectionList.perf-test.tsx index c6d30f4375fa..112f0ef15dc8 100644 --- a/tests/perf-test/SelectionList.perf-test.tsx +++ b/tests/perf-test/SelectionList.perf-test.tsx @@ -68,7 +68,6 @@ jest.mock('@react-navigation/native', () => ({ })); jest.mock('../../src/hooks/useKeyboardState', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => ({ isKeyboardShown: false, @@ -77,7 +76,6 @@ jest.mock('../../src/hooks/useKeyboardState', () => ({ })); jest.mock('../../src/hooks/useScreenWrapperTransitionStatus', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => ({ didScreenTransitionEnd: true, diff --git a/tests/perf-test/useAdvancedSearchFilters.perf-test.tsx b/tests/perf-test/useAdvancedSearchFilters.perf-test.tsx index 0483e3428ce0..3d95b33d27f3 100644 --- a/tests/perf-test/useAdvancedSearchFilters.perf-test.tsx +++ b/tests/perf-test/useAdvancedSearchFilters.perf-test.tsx @@ -34,7 +34,6 @@ jest.mock('@src/libs/Navigation/Navigation', () => ({ })); jest.mock('@hooks/useExportedToFilterOptions', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ exportedToFilterOptions: [], diff --git a/tests/ui/AuthScreensInitHandlerTest.tsx b/tests/ui/AuthScreensInitHandlerTest.tsx index 929f96fe6d68..d3dc6ee69acc 100644 --- a/tests/ui/AuthScreensInitHandlerTest.tsx +++ b/tests/ui/AuthScreensInitHandlerTest.tsx @@ -24,7 +24,6 @@ import wrapOnyxWithWaitForBatchedUpdates from '../utils/wrapOnyxWithWaitForBatch const TEST_ACCOUNT_ID = 1; jest.mock('@libs/Pusher', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { init: jest.fn(() => Promise.resolve()), @@ -32,7 +31,6 @@ jest.mock('@libs/Pusher', () => ({ })); jest.mock('@libs/PusherConnectionManager', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { init: jest.fn(), @@ -40,7 +38,6 @@ jest.mock('@libs/PusherConnectionManager', () => ({ })); jest.mock('@libs/Navigation/Navigation', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { isActiveRoute: jest.fn(() => false), @@ -51,7 +48,6 @@ jest.mock('@libs/Navigation/Navigation', () => ({ })); jest.mock('@libs/Navigation/currentUrl', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => ''), })); diff --git a/tests/ui/AvatarSelector.test.tsx b/tests/ui/AvatarSelector.test.tsx index 3f1462dc7081..cb0091ec99f0 100644 --- a/tests/ui/AvatarSelector.test.tsx +++ b/tests/ui/AvatarSelector.test.tsx @@ -11,7 +11,6 @@ import ONYXKEYS from '@src/ONYXKEYS'; import waitForBatchedUpdates from '../utils/waitForBatchedUpdates'; jest.mock('@hooks/useLetterAvatars', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: (name?: string) => { if (!name) { diff --git a/tests/ui/ChronosTimerHeaderButton.test.tsx b/tests/ui/ChronosTimerHeaderButton.test.tsx index ab294efe962b..481d2300457e 100644 --- a/tests/ui/ChronosTimerHeaderButton.test.tsx +++ b/tests/ui/ChronosTimerHeaderButton.test.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention -- Mock module paths use non-standard naming conventions required by jest.mock */ import {PortalProvider} from '@gorhom/portal'; import {fireEvent, render, screen, waitFor} from '@testing-library/react-native'; import React from 'react'; diff --git a/tests/ui/FlightTripDetailsTest.tsx b/tests/ui/FlightTripDetailsTest.tsx index fb998c09d91f..f89b8f56b443 100644 --- a/tests/ui/FlightTripDetailsTest.tsx +++ b/tests/ui/FlightTripDetailsTest.tsx @@ -4,7 +4,6 @@ import CONST from '@src/CONST'; import type {Reservation} from '@src/types/onyx/Transaction'; jest.mock('@hooks/useScreenWrapperTransitionStatus', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ didScreenTransitionEnd: true, diff --git a/tests/ui/GroupChatNameTests.tsx b/tests/ui/GroupChatNameTests.tsx index fedaa6eef745..8ee16a6e8bae 100644 --- a/tests/ui/GroupChatNameTests.tsx +++ b/tests/ui/GroupChatNameTests.tsx @@ -26,7 +26,6 @@ jest.mock('../../src/components/ConfirmedRoute.tsx'); // Needed for: https://stackoverflow.com/questions/76903168/mocking-libraries-in-jest jest.mock('react-native/Libraries/LogBox/LogBox', () => ({ - /* eslint-disable-next-line @typescript-eslint/naming-convention */ __esModule: true, default: { ignoreLogs: jest.fn(), diff --git a/tests/ui/IOURequestStepDistanceTest.tsx b/tests/ui/IOURequestStepDistanceTest.tsx index bc3228e5e050..c18138044549 100644 --- a/tests/ui/IOURequestStepDistanceTest.tsx +++ b/tests/ui/IOURequestStepDistanceTest.tsx @@ -140,7 +140,6 @@ jest.mock('@components/DistanceRequest/DistanceRequestFooter', () => { }); jest.mock('@hooks/useScreenWrapperTransitionStatus', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({didScreenTransitionEnd: true}), })); diff --git a/tests/ui/MoneyRequestReportPreview.test.tsx b/tests/ui/MoneyRequestReportPreview.test.tsx index 90ea067d3af3..1607c016f88f 100644 --- a/tests/ui/MoneyRequestReportPreview.test.tsx +++ b/tests/ui/MoneyRequestReportPreview.test.tsx @@ -59,7 +59,6 @@ jest.mock('@rnmapbox/maps', () => { const mockUseReportWithTransactionsAndViolations = jest.fn(() => defaultReportWithTransactionsAndViolations); jest.mock('@src/hooks/useReportWithTransactionsAndViolations', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention -- __esModule is required by Jest to properly mock ES modules with default exports __esModule: true, default: (...args: Parameters) => mockUseReportWithTransactionsAndViolations(...args), })); diff --git a/tests/ui/MultifactorAuthenticationRevokePageTest.tsx b/tests/ui/MultifactorAuthenticationRevokePageTest.tsx index 86f99fa4c496..a9ab804374a3 100644 --- a/tests/ui/MultifactorAuthenticationRevokePageTest.tsx +++ b/tests/ui/MultifactorAuthenticationRevokePageTest.tsx @@ -18,7 +18,6 @@ let mockBiometricStatus = { }; jest.mock('@hooks/useBiometricRegistrationStatus', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => mockBiometricStatus, })); @@ -37,7 +36,6 @@ jest.mock('@libs/Navigation/Navigation', () => ({ })); jest.mock('@hooks/useLocalize', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ translate: (key: string) => key, @@ -45,7 +43,6 @@ jest.mock('@hooks/useLocalize', () => ({ })); jest.mock('@hooks/useThemeStyles', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => new Proxy( diff --git a/tests/ui/NewChatPageTest.tsx b/tests/ui/NewChatPageTest.tsx index 9ea4191056fa..7fba20643122 100644 --- a/tests/ui/NewChatPageTest.tsx +++ b/tests/ui/NewChatPageTest.tsx @@ -20,7 +20,6 @@ import waitForBatchedUpdatesWithAct from '../utils/waitForBatchedUpdatesWithAct' jest.mock('@react-navigation/native'); jest.mock('@src/libs/Navigation/navigationRef'); jest.mock('react-native-permissions', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, RESULTS: { UNAVAILABLE: 'unavailable', diff --git a/tests/ui/ParentNavigationSubtitleTest.tsx b/tests/ui/ParentNavigationSubtitleTest.tsx index b5f753daf7d4..6e761b532eae 100644 --- a/tests/ui/ParentNavigationSubtitleTest.tsx +++ b/tests/ui/ParentNavigationSubtitleTest.tsx @@ -16,7 +16,6 @@ jest.mock('@libs/ReportActionsUtils', () => ({ const mockUseRootNavigationState = jest.fn(); jest.mock('@hooks/useRootNavigationState', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: (selector?: (state: unknown) => unknown) => mockUseRootNavigationState(selector) as unknown, })); diff --git a/tests/ui/ReservationAddressTest.tsx b/tests/ui/ReservationAddressTest.tsx index 11d30c939123..6adb9c2ec9cc 100644 --- a/tests/ui/ReservationAddressTest.tsx +++ b/tests/ui/ReservationAddressTest.tsx @@ -6,7 +6,6 @@ import HotelTripDetails from '@pages/Travel/HotelTripDetails'; import CONST from '@src/CONST'; jest.mock('@hooks/useScreenWrapperTransitionStatus', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ didScreenTransitionEnd: true, // or false, depending on your desired behavior diff --git a/tests/ui/TestToolMenuBiometricsTest.tsx b/tests/ui/TestToolMenuBiometricsTest.tsx index 9928527bedd3..b9d89ec22e18 100644 --- a/tests/ui/TestToolMenuBiometricsTest.tsx +++ b/tests/ui/TestToolMenuBiometricsTest.tsx @@ -17,7 +17,6 @@ let mockBiometricStatus = { jest.mock('@hooks/useBiometricRegistrationStatus', () => { const actual = require('@libs/MultifactorAuthentication/shared/VALUES') as {default: {REGISTRATION_STATUS: Record}}; return { - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => mockBiometricStatus, REGISTRATION_STATUS: actual.default.REGISTRATION_STATUS, @@ -25,13 +24,11 @@ jest.mock('@hooks/useBiometricRegistrationStatus', () => { }); jest.mock('@hooks/useIsAuthenticated', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => true, })); jest.mock('@hooks/useLocalize', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ translate: (key: string, params?: Record) => { @@ -47,7 +44,6 @@ jest.mock('@hooks/useLocalize', () => ({ })); jest.mock('@hooks/useOnyx', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => [undefined], })); @@ -57,13 +53,11 @@ jest.mock('@hooks/useSidebarOrderedReports', () => ({ })); jest.mock('@hooks/useSingleExecution', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({singleExecution: (fn: () => void) => fn}), })); jest.mock('@hooks/useThemeStyles', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => new Proxy( @@ -75,7 +69,6 @@ jest.mock('@hooks/useThemeStyles', () => ({ })); jest.mock('@hooks/useWaitForNavigation', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => (fn: () => void) => fn, })); diff --git a/tests/ui/components/DisplayNames.test.tsx b/tests/ui/components/DisplayNames.test.tsx index 3ad254dc1faf..2be0f12289ca 100644 --- a/tests/ui/components/DisplayNames.test.tsx +++ b/tests/ui/components/DisplayNames.test.tsx @@ -4,7 +4,6 @@ import DisplayNames from '@components/DisplayNames'; import Parser from '@libs/Parser'; jest.mock('@libs/Parser', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { htmlToText: jest.fn((html: string) => html.replaceAll(/<[^>]*>/g, '')), @@ -12,7 +11,6 @@ jest.mock('@libs/Parser', () => ({ })); jest.mock('@hooks/useLocalize', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => ({ translate: jest.fn((key: string) => key), diff --git a/tests/ui/components/IOURequestStepDistanceTest.tsx b/tests/ui/components/IOURequestStepDistanceTest.tsx index f1237586b857..27bf4ad685d7 100644 --- a/tests/ui/components/IOURequestStepDistanceTest.tsx +++ b/tests/ui/components/IOURequestStepDistanceTest.tsx @@ -100,7 +100,6 @@ jest.mock('@react-navigation/native', () => { }); jest.mock('@hooks/useScreenWrapperTransitionStatus', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ didScreenTransitionEnd: true, diff --git a/tests/ui/components/LHNOptionsListTest.tsx b/tests/ui/components/LHNOptionsListTest.tsx index 89ad6fb6c560..ae1f424d8ce9 100644 --- a/tests/ui/components/LHNOptionsListTest.tsx +++ b/tests/ui/components/LHNOptionsListTest.tsx @@ -25,7 +25,6 @@ jest.mock('@src/languages/IntlStore', () => { const cache = new Map>([['en', flattenObject(en)]]); return { - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { getCurrentLocale: () => 'en', diff --git a/tests/ui/components/PopoverMenu.tsx b/tests/ui/components/PopoverMenu.tsx index cec79064953d..452b1285ebfc 100644 --- a/tests/ui/components/PopoverMenu.tsx +++ b/tests/ui/components/PopoverMenu.tsx @@ -140,7 +140,6 @@ describe('PopoverMenu utils', () => { jest.mock('@components/PopoverWithMeasuredContent', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: (props: PropsWithChildren>) => props.children, }; @@ -151,7 +150,6 @@ jest.mock('@components/FocusableMenuItem', () => { const {Pressable, Text} = require('react-native'); return { - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: (props: {title: string; pressableTestID?: string; onPress?: (event: GestureResponderEvent) => void}) => ( ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), })); diff --git a/tests/ui/components/SearchAutocompleteListTest.tsx b/tests/ui/components/SearchAutocompleteListTest.tsx index 6ef4e761e249..d99a312b745d 100644 --- a/tests/ui/components/SearchAutocompleteListTest.tsx +++ b/tests/ui/components/SearchAutocompleteListTest.tsx @@ -26,7 +26,6 @@ jest.mock('@react-navigation/native', () => ({ })); jest.mock('@hooks/useResponsiveLayout', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => ({ shouldUseNarrowLayout: true, @@ -35,7 +34,6 @@ jest.mock('@hooks/useResponsiveLayout', () => ({ })); jest.mock('@hooks/useFilteredOptions', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => ({ options: { diff --git a/tests/ui/components/TimePickerTest.tsx b/tests/ui/components/TimePickerTest.tsx index fa27b7bbb512..e6078be79bf1 100644 --- a/tests/ui/components/TimePickerTest.tsx +++ b/tests/ui/components/TimePickerTest.tsx @@ -52,7 +52,6 @@ jest.mock('react-native/Libraries/Components/TextInput/TextInput', () => { } return { - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: TextInputMock, }; diff --git a/tests/unit/AgentZeroStatusContextTest.ts b/tests/unit/AgentZeroStatusContextTest.ts index a7e5cd33fb75..ce91711d6300 100644 --- a/tests/unit/AgentZeroStatusContextTest.ts +++ b/tests/unit/AgentZeroStatusContextTest.ts @@ -14,7 +14,6 @@ const mockTranslate = jest.fn((key: string) => { }); jest.mock('@hooks/useLocalize', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ translate: mockTranslate, diff --git a/tests/unit/ConfirmContentTest.tsx b/tests/unit/ConfirmContentTest.tsx index 3a2288502811..a38a19e6d351 100644 --- a/tests/unit/ConfirmContentTest.tsx +++ b/tests/unit/ConfirmContentTest.tsx @@ -15,7 +15,6 @@ const mockButtonSpy = jest.fn(); jest.mock('@components/Button', () => { const ReactLib = jest.requireActual('react'); return { - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: (props: ButtonProps) => { mockButtonSpy(props); diff --git a/tests/unit/ContextMenuActionsCopyMessageTest.ts b/tests/unit/ContextMenuActionsCopyMessageTest.ts index 000d4dbd8218..d991119ba915 100644 --- a/tests/unit/ContextMenuActionsCopyMessageTest.ts +++ b/tests/unit/ContextMenuActionsCopyMessageTest.ts @@ -14,7 +14,6 @@ jest.mock('@components/Reactions/MiniQuickEmojiReactions', () => 'MiniQuickEmoji jest.mock('@components/Reactions/QuickEmojiReactions', () => 'QuickEmojiReactions'); jest.mock('@libs/Clipboard', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { canSetHtml: jest.fn(), @@ -24,7 +23,6 @@ jest.mock('@libs/Clipboard', () => ({ })); jest.mock('@libs/Clipboard/getClipboardText', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), })); diff --git a/tests/unit/EnvironmentContextTest.tsx b/tests/unit/EnvironmentContextTest.tsx index aa38564e7adc..d8ab8f09a1e7 100644 --- a/tests/unit/EnvironmentContextTest.tsx +++ b/tests/unit/EnvironmentContextTest.tsx @@ -8,7 +8,6 @@ const mockGetEnvironment: jest.MockedFunction<() => Promise> = jest.fn() const mockGetEnvironmentURL: jest.MockedFunction<() => Promise> = jest.fn(); jest.mock('@libs/Environment/getEnvironment', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => mockGetEnvironment()), })); diff --git a/tests/unit/GoogleTagManagerTest.tsx b/tests/unit/GoogleTagManagerTest.tsx index e701fb6a85f9..b4420f855c14 100644 --- a/tests/unit/GoogleTagManagerTest.tsx +++ b/tests/unit/GoogleTagManagerTest.tsx @@ -41,7 +41,6 @@ jest.mock('@libs/Navigation/navigationRef', () => { index: 0, }; return { - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { getRootState: jest.fn(() => mockState), diff --git a/tests/unit/LightboxTest.tsx b/tests/unit/LightboxTest.tsx index 36606b20df6c..7e9f3be3db7f 100644 --- a/tests/unit/LightboxTest.tsx +++ b/tests/unit/LightboxTest.tsx @@ -19,14 +19,12 @@ jest.mock('@components/Image', () => { }); } return { - // eslint-disable-next-line @typescript-eslint/naming-convention -- __esModule is required by Jest to properly mock ES modules with default exports __esModule: true, default: MockReact.memo(MockImage), }; }); jest.mock('@components/Lightbox/numberOfConcurrentLightboxes', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention -- __esModule is required by Jest to properly mock ES modules with default exports __esModule: true, default: 3, })); @@ -35,7 +33,6 @@ jest.mock('@components/MultiGestureCanvas', () => { const MockReact = require('react') as typeof React; const {View} = require('react-native') as {View: typeof RNView}; return { - // eslint-disable-next-line @typescript-eslint/naming-convention -- __esModule is required by Jest to properly mock ES modules with default exports __esModule: true, default: ({children}: {children: React.ReactNode}) => MockReact.createElement(View, {testID: 'multi-gesture-canvas'}, children), DEFAULT_ZOOM_RANGE: {min: 1, max: 5}, diff --git a/tests/unit/ReconnectTest.ts b/tests/unit/ReconnectTest.ts index 9924008aa83d..d011dd00cbb4 100644 --- a/tests/unit/ReconnectTest.ts +++ b/tests/unit/ReconnectTest.ts @@ -13,7 +13,6 @@ jest.mock('@libs/Log'); jest.mock('@libs/Network/SequentialQueue', () => ({flush: jest.fn()})); jest.mock('@libs/actions/App', () => ({openApp: jest.fn(), reconnectApp: jest.fn(), confirmReadyToOpenApp: jest.fn()})); jest.mock('@libs/AppStateMonitor', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention -- required by Jest for ES module interop __esModule: true, default: { addBecameActiveListener: jest.fn(() => jest.fn()), diff --git a/tests/unit/RefreshCardFeedConnectionPageTest.tsx b/tests/unit/RefreshCardFeedConnectionPageTest.tsx index 02cc6210787f..005e4c1c65d3 100644 --- a/tests/unit/RefreshCardFeedConnectionPageTest.tsx +++ b/tests/unit/RefreshCardFeedConnectionPageTest.tsx @@ -13,13 +13,11 @@ jest.mock('@pages/workspace/withPolicyAndFullscreenLoading', () => (Component: R const mockCloseRHPFlow = jest.fn(); jest.mock('@hooks/useCardFeeds', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), })); jest.mock('@pages/workspace/companyCards/BankConnection', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => { @@ -30,7 +28,6 @@ jest.mock('@pages/workspace/companyCards/BankConnection', () => ({ })); jest.mock('@pages/workspace/companyCards/addNew/PlaidConnectionStep', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => { @@ -41,7 +38,6 @@ jest.mock('@pages/workspace/companyCards/addNew/PlaidConnectionStep', () => ({ })); jest.mock('@pages/LoadingPage', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => { @@ -52,7 +48,6 @@ jest.mock('@pages/LoadingPage', () => ({ })); jest.mock('@pages/ErrorPage/NotFoundPage', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => { @@ -75,7 +70,6 @@ jest.mock('@libs/actions/CompanyCards', () => ({ })); jest.mock('@hooks/useLocalize', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({translate: (key: string) => key}), })); diff --git a/tests/unit/Search/SearchListRenderCountTest.tsx b/tests/unit/Search/SearchListRenderCountTest.tsx index 84ed0e3cc0e3..7e257b7e6ff4 100644 --- a/tests/unit/Search/SearchListRenderCountTest.tsx +++ b/tests/unit/Search/SearchListRenderCountTest.tsx @@ -33,7 +33,6 @@ jest.mock('@hooks/useNetwork', () => ); jest.mock('@hooks/useKeyboardState', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => ({ isKeyboardShown: false, @@ -42,7 +41,6 @@ jest.mock('@hooks/useKeyboardState', () => ({ })); jest.mock('@hooks/useResponsiveLayout', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => ({ isSmallScreenWidth: false, @@ -52,7 +50,6 @@ jest.mock('@hooks/useResponsiveLayout', () => ({ })); jest.mock('@hooks/useSafeAreaPaddings', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => ({ safeAreaPaddingBottomStyle: {}, @@ -60,7 +57,6 @@ jest.mock('@hooks/useSafeAreaPaddings', () => ({ })); jest.mock('@hooks/useWindowDimensions', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => ({ windowWidth: 1200, diff --git a/tests/unit/SearchAutocompleteListTest.tsx b/tests/unit/SearchAutocompleteListTest.tsx index 1bca8d831fd1..455d8e9386fc 100644 --- a/tests/unit/SearchAutocompleteListTest.tsx +++ b/tests/unit/SearchAutocompleteListTest.tsx @@ -40,7 +40,6 @@ jest.mock('@src/libs/API', () => ({ jest.mock('@components/Search/DeferredSearchAutocompleteList', () => { const module = jest.requireActual<{default: React.ComponentType}>('@components/Search/SearchAutocompleteList'); return { - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: module.default, @@ -56,13 +55,11 @@ jest.mock('@src/libs/Navigation/Navigation', () => ({ })); jest.mock('@src/hooks/useRootNavigationState', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({contextualReportID: undefined, isSearchRouterScreen: false}), })); jest.mock('@hooks/useExportedToFilterOptions', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ exportedToFilterOptions: [], diff --git a/tests/unit/SettlementButtonUtilsTest.ts b/tests/unit/SettlementButtonUtilsTest.ts index cca208d59e11..87b6a40ec029 100644 --- a/tests/unit/SettlementButtonUtilsTest.ts +++ b/tests/unit/SettlementButtonUtilsTest.ts @@ -11,7 +11,6 @@ jest.mock('@libs/Navigation/Navigation'); const mockTranslate = jest.fn((key: string) => key); jest.mock('@hooks/useLocalize', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ translate: mockTranslate, diff --git a/tests/unit/TelemetrySynchronizerTest.ts b/tests/unit/TelemetrySynchronizerTest.ts index 8dac94878dba..f6c10dfacf5e 100644 --- a/tests/unit/TelemetrySynchronizerTest.ts +++ b/tests/unit/TelemetrySynchronizerTest.ts @@ -18,7 +18,6 @@ jest.mock('@libs/PolicyUtils', () => ({ })); jest.mock('@libs/telemetry/sendMemoryContext', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), initializeMemoryTracking: jest.fn(), diff --git a/tests/unit/WhisperContentMentionContextTest.tsx b/tests/unit/WhisperContentMentionContextTest.tsx index 987a9f9e8d68..85d1873e072d 100644 --- a/tests/unit/WhisperContentMentionContextTest.tsx +++ b/tests/unit/WhisperContentMentionContextTest.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import {act, render, screen} from '@testing-library/react-native'; import React from 'react'; import Onyx from 'react-native-onyx'; diff --git a/tests/unit/components/MultifactorAuthentication/useNativeBiometricsHSM.test.ts b/tests/unit/components/MultifactorAuthentication/useNativeBiometricsHSM.test.ts index 73cd6d44d53d..a6c02e15626a 100644 --- a/tests/unit/components/MultifactorAuthentication/useNativeBiometricsHSM.test.ts +++ b/tests/unit/components/MultifactorAuthentication/useNativeBiometricsHSM.test.ts @@ -6,7 +6,6 @@ import VALUES from '@libs/MultifactorAuthentication/VALUES'; import CONST from '@src/CONST'; jest.mock('@hooks/useCurrentUserPersonalDetails', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ accountID: 12345, @@ -14,7 +13,6 @@ jest.mock('@hooks/useCurrentUserPersonalDetails', () => ({ })); jest.mock('@hooks/useLocalize', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ translate: (key: string) => `translated_${key}`, @@ -24,7 +22,6 @@ jest.mock('@hooks/useLocalize', () => ({ let mockMultifactorAuthenticationPublicKeyIDs: string[] | undefined = []; jest.mock('@hooks/useOnyx', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => [mockMultifactorAuthenticationPublicKeyIDs], })); diff --git a/tests/unit/generateTranslationsTest.ts b/tests/unit/generateTranslationsTest.ts index 8680367bc964..d0467f1e61c6 100644 --- a/tests/unit/generateTranslationsTest.ts +++ b/tests/unit/generateTranslationsTest.ts @@ -16,7 +16,6 @@ let consoleErrorSpy: jest.SpyInstance; // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment let mockEn: any = jest.requireActual('@src/languages/en'); jest.mock('@src/languages/en', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment get default() { diff --git a/tests/unit/hooks/useActiveAdminPolicies.test.ts b/tests/unit/hooks/useActiveAdminPolicies.test.ts index f95f9a64907a..63b4266e554f 100644 --- a/tests/unit/hooks/useActiveAdminPolicies.test.ts +++ b/tests/unit/hooks/useActiveAdminPolicies.test.ts @@ -10,7 +10,6 @@ import waitForBatchedUpdates from '../../utils/waitForBatchedUpdates'; const TEST_LOGIN = 'admin@expensify.com'; jest.mock('@hooks/useCurrentUserPersonalDetails', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => ({login: TEST_LOGIN})), })); diff --git a/tests/unit/hooks/useAdvancedSearchFilters.test.ts b/tests/unit/hooks/useAdvancedSearchFilters.test.ts index fac2fcec2fe3..93bb82d50494 100644 --- a/tests/unit/hooks/useAdvancedSearchFilters.test.ts +++ b/tests/unit/hooks/useAdvancedSearchFilters.test.ts @@ -27,7 +27,6 @@ jest.mock('@src/libs/Navigation/Navigation', () => ({ })); jest.mock('@hooks/useExportedToFilterOptions', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ exportedToFilterOptions: [], diff --git a/tests/unit/hooks/useAutocompleteSuggestions.test.ts b/tests/unit/hooks/useAutocompleteSuggestions.test.ts index 551e5391fcb8..bd7265761a6d 100644 --- a/tests/unit/hooks/useAutocompleteSuggestions.test.ts +++ b/tests/unit/hooks/useAutocompleteSuggestions.test.ts @@ -7,7 +7,6 @@ import type {Policy} from '@src/types/onyx'; const onyxData: Record = {}; jest.mock('@hooks/useOnyx', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: (key: string) => [onyxData[key]], })); @@ -81,7 +80,6 @@ jest.mock('@libs/SearchUIUtils', () => ({ })); jest.mock('@hooks/useExportedToFilterOptions', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention -- mock must match the default export shape __esModule: true, default: () => ({ exportedToFilterOptions: ['QuickBooks Online', 'Xero', 'NetSuite'], diff --git a/tests/unit/hooks/useBiometricRegistrationStatusTest.tsx b/tests/unit/hooks/useBiometricRegistrationStatusTest.tsx index 4809c50ea682..1f54e3cf030d 100644 --- a/tests/unit/hooks/useBiometricRegistrationStatusTest.tsx +++ b/tests/unit/hooks/useBiometricRegistrationStatusTest.tsx @@ -9,7 +9,6 @@ let mockServerKnownCredentialIDs: string[]; let mockHaveCredentialsEverBeenConfigured: boolean; jest.mock('@components/MultifactorAuthentication/biometrics/useBiometrics', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ getLocalCredentialID: mockGetLocalCredentialID, diff --git a/tests/unit/hooks/useCopySelectionHelper.test.ts b/tests/unit/hooks/useCopySelectionHelper.test.ts index 9ed22d5e9c1a..852a1e0c1266 100644 --- a/tests/unit/hooks/useCopySelectionHelper.test.ts +++ b/tests/unit/hooks/useCopySelectionHelper.test.ts @@ -7,7 +7,6 @@ import SelectionScraper from '@libs/SelectionScraper'; import CONST from '@src/CONST'; jest.mock('@libs/Clipboard', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { canSetHtml: jest.fn(), @@ -17,13 +16,11 @@ jest.mock('@libs/Clipboard', () => ({ })); jest.mock('@libs/Clipboard/getClipboardText', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), })); jest.mock('@libs/KeyboardShortcut', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { subscribe: jest.fn(), @@ -31,7 +28,6 @@ jest.mock('@libs/KeyboardShortcut', () => ({ })); jest.mock('@libs/SelectionScraper', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { getCurrentSelection: jest.fn(), diff --git a/tests/unit/hooks/useDistanceRequestState.test.ts b/tests/unit/hooks/useDistanceRequestState.test.ts index 0e2d9f9a5734..c775ff1015d4 100644 --- a/tests/unit/hooks/useDistanceRequestState.test.ts +++ b/tests/unit/hooks/useDistanceRequestState.test.ts @@ -3,7 +3,6 @@ import useDistanceRequestState from '@components/MoneyRequestConfirmationList/ho import type * as OnyxTypes from '@src/types/onyx'; jest.mock('@libs/DistanceRequestUtils', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { getDefaultMileageRate: () => undefined, diff --git a/tests/unit/hooks/useExpensifyCardFeedsForFeedSelector.test.ts b/tests/unit/hooks/useExpensifyCardFeedsForFeedSelector.test.ts index 4b200a5bba6c..9033c69ccf13 100644 --- a/tests/unit/hooks/useExpensifyCardFeedsForFeedSelector.test.ts +++ b/tests/unit/hooks/useExpensifyCardFeedsForFeedSelector.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import {renderHook} from '@testing-library/react-native'; import useExpensifyCardFeedsForFeedSelector from '@hooks/useExpensifyCardFeedsForFeedSelector'; import CONST from '@src/CONST'; diff --git a/tests/unit/hooks/useFreeTrial.test.ts b/tests/unit/hooks/useFreeTrial.test.ts index fd7d46af44e4..64167ac75a33 100644 --- a/tests/unit/hooks/useFreeTrial.test.ts +++ b/tests/unit/hooks/useFreeTrial.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import {renderHook} from '@testing-library/react-native'; import Onyx from 'react-native-onyx'; import useHasTeam2025Pricing from '@hooks/useHasTeam2025Pricing'; diff --git a/tests/unit/hooks/useHasAnyAdminExpensifyCardFeed.test.ts b/tests/unit/hooks/useHasAnyAdminExpensifyCardFeed.test.ts index d71c9a3da5a7..50ba4d2a3b83 100644 --- a/tests/unit/hooks/useHasAnyAdminExpensifyCardFeed.test.ts +++ b/tests/unit/hooks/useHasAnyAdminExpensifyCardFeed.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import {renderHook} from '@testing-library/react-native'; import useHasAnyAdminExpensifyCardFeed from '@hooks/useHasAnyAdminExpensifyCardFeed'; import CONST from '@src/CONST'; diff --git a/tests/unit/hooks/useIsAllowedToIssueCompanyCard.test.ts b/tests/unit/hooks/useIsAllowedToIssueCompanyCard.test.ts index e8de8e1929f5..b1f5ad50ca76 100644 --- a/tests/unit/hooks/useIsAllowedToIssueCompanyCard.test.ts +++ b/tests/unit/hooks/useIsAllowedToIssueCompanyCard.test.ts @@ -34,13 +34,11 @@ const mockedFeeds = { }; jest.mock('@hooks/useCardFeeds', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), })); jest.mock('@hooks/useCurrentUserPersonalDetails', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({accountID: currentUserAccountID}), })); diff --git a/tests/unit/hooks/useIsBlockedToAddFeed.test.ts b/tests/unit/hooks/useIsBlockedToAddFeed.test.ts index 0d8e614b8a50..8284eb1cea63 100644 --- a/tests/unit/hooks/useIsBlockedToAddFeed.test.ts +++ b/tests/unit/hooks/useIsBlockedToAddFeed.test.ts @@ -35,7 +35,6 @@ const mockCardFeeds = { }; jest.mock('@hooks/useCardFeeds', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), })); diff --git a/tests/unit/hooks/useLazyAsset.test.ts b/tests/unit/hooks/useLazyAsset.test.ts index 36cc72e9904d..0d38166a243f 100644 --- a/tests/unit/hooks/useLazyAsset.test.ts +++ b/tests/unit/hooks/useLazyAsset.test.ts @@ -33,7 +33,6 @@ jest.mock('@hooks/useLazyAsset', () => { const actual = jest.requireActual('@hooks/useLazyAsset'); // eslint-disable-next-line @typescript-eslint/no-unsafe-return return { - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, ...actual, diff --git a/tests/unit/hooks/useOtherFeedsForFeedSelector.test.tsx b/tests/unit/hooks/useOtherFeedsForFeedSelector.test.tsx index 4a47e2a4b2a8..a531910d982b 100644 --- a/tests/unit/hooks/useOtherFeedsForFeedSelector.test.tsx +++ b/tests/unit/hooks/useOtherFeedsForFeedSelector.test.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import {renderHook} from '@testing-library/react-native'; import React from 'react'; import useCardFeedErrors from '@hooks/useCardFeedErrors'; diff --git a/tests/unit/hooks/useReceiptPreviewsSizes.test.ts b/tests/unit/hooks/useReceiptPreviewsSizes.test.ts index 67521e46f4f7..5334cf6fc53d 100644 --- a/tests/unit/hooks/useReceiptPreviewsSizes.test.ts +++ b/tests/unit/hooks/useReceiptPreviewsSizes.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention -- Mock module paths use non-standard naming conventions required by jest.mock */ import {renderHook} from '@testing-library/react-native'; import useReceiptPreviewsSizes from '@pages/iou/request/step/IOURequestStepScan/hooks/useReceiptPreviewsSizes'; diff --git a/tests/unit/hooks/useReceiptScan.test.ts b/tests/unit/hooks/useReceiptScan.test.ts index 33d059507abf..7ee38640e129 100644 --- a/tests/unit/hooks/useReceiptScan.test.ts +++ b/tests/unit/hooks/useReceiptScan.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable @typescript-eslint/no-unsafe-return */ import {act, renderHook} from '@testing-library/react-native'; import Onyx from 'react-native-onyx'; diff --git a/tests/unit/hooks/useRestoreWorkspacesTabOnNavigate.test.ts b/tests/unit/hooks/useRestoreWorkspacesTabOnNavigate.test.ts index b33e44973a1e..d00734b622ff 100644 --- a/tests/unit/hooks/useRestoreWorkspacesTabOnNavigate.test.ts +++ b/tests/unit/hooks/useRestoreWorkspacesTabOnNavigate.test.ts @@ -43,7 +43,6 @@ jest.mock('@libs/Navigation/Navigation', () => ({ })); jest.mock('@libs/Navigation/helpers/getPathFromState', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), })); diff --git a/tests/unit/hooks/useSearchSections.test.ts b/tests/unit/hooks/useSearchSections.test.ts index 890f1157e0f2..f0a1ce8831a4 100644 --- a/tests/unit/hooks/useSearchSections.test.ts +++ b/tests/unit/hooks/useSearchSections.test.ts @@ -21,19 +21,16 @@ const mockUseOnyx = jest.fn( ); jest.mock('@hooks/useOnyx', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: (key: string, options?: {selector?: (value: unknown) => unknown}) => mockUseOnyx(key, options), })); jest.mock('@hooks/useCurrentUserPersonalDetails', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({accountID: 1, email: 'test@test.com'}), })); jest.mock('@hooks/useLocalize', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ localeCompare: (a: string, b: string) => a.localeCompare(b), @@ -43,13 +40,11 @@ jest.mock('@hooks/useLocalize', () => ({ })); jest.mock('@hooks/useActionLoadingReportIDs', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => new Set(), })); jest.mock('@hooks/useArchivedReportsIdSet', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => new Set(), })); diff --git a/tests/unit/hooks/useSearchShouldCalculateTotals.test.ts b/tests/unit/hooks/useSearchShouldCalculateTotals.test.ts index b0b88c759500..c9189934f4bc 100644 --- a/tests/unit/hooks/useSearchShouldCalculateTotals.test.ts +++ b/tests/unit/hooks/useSearchShouldCalculateTotals.test.ts @@ -19,7 +19,6 @@ const mockUseOnyx = jest.fn( ); jest.mock('@hooks/useOnyx', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: (key: string, options?: {selector?: (value: unknown) => unknown}) => mockUseOnyx(key, options), })); diff --git a/tests/unit/hooks/useSelectedTransactionsActions.test.ts b/tests/unit/hooks/useSelectedTransactionsActions.test.ts index 0d8b309b2e56..263c26ca1e06 100644 --- a/tests/unit/hooks/useSelectedTransactionsActions.test.ts +++ b/tests/unit/hooks/useSelectedTransactionsActions.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import {act, renderHook, waitFor} from '@testing-library/react-native'; import Onyx from 'react-native-onyx'; import type {OnyxEntry} from 'react-native-onyx'; diff --git a/tests/unit/hooks/useSortedActiveAdminPolicies.test.ts b/tests/unit/hooks/useSortedActiveAdminPolicies.test.ts index ff5c6f8be22f..408f0c41878e 100644 --- a/tests/unit/hooks/useSortedActiveAdminPolicies.test.ts +++ b/tests/unit/hooks/useSortedActiveAdminPolicies.test.ts @@ -7,13 +7,11 @@ import createRandomPolicy from '../../utils/collections/policies'; const mockUseActiveAdminPolicies = jest.fn(() => []); jest.mock('@hooks/useActiveAdminPolicies', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => mockUseActiveAdminPolicies(), })); jest.mock('@hooks/useLocalize', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => ({ localeCompare: (a: string, b: string) => a.localeCompare(b), diff --git a/tests/unit/hooks/useSplitParticipants.test.tsx b/tests/unit/hooks/useSplitParticipants.test.tsx index 9568af77efcd..06d768aee677 100644 --- a/tests/unit/hooks/useSplitParticipants.test.tsx +++ b/tests/unit/hooks/useSplitParticipants.test.tsx @@ -12,7 +12,6 @@ import type {CurrentUserPersonalDetails} from '@src/types/onyx/PersonalDetails'; import waitForBatchedUpdatesWithAct from '../../utils/waitForBatchedUpdatesWithAct'; jest.mock('@hooks/useThemeStyles', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => new Proxy( @@ -36,7 +35,6 @@ jest.mock('@components/MoneyRequestAmountInput', () => { } MoneyRequestAmountInputMock.displayName = 'MoneyRequestAmountInputMock'; return { - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: MoneyRequestAmountInputMock, }; diff --git a/tests/unit/hooks/useTaxAmount.test.ts b/tests/unit/hooks/useTaxAmount.test.ts index 007102f11bbb..cdd52f70771f 100644 --- a/tests/unit/hooks/useTaxAmount.test.ts +++ b/tests/unit/hooks/useTaxAmount.test.ts @@ -11,7 +11,6 @@ jest.mock('@libs/CurrencyUtils', () => ({ })); jest.mock('@libs/DistanceRequestUtils', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { getTaxableAmount: () => 100, diff --git a/tests/unit/hooks/useTimeSensitiveAddPaymentCard.test.ts b/tests/unit/hooks/useTimeSensitiveAddPaymentCard.test.ts index d2088d7f8305..04576f50fdb1 100644 --- a/tests/unit/hooks/useTimeSensitiveAddPaymentCard.test.ts +++ b/tests/unit/hooks/useTimeSensitiveAddPaymentCard.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import {renderHook} from '@testing-library/react-native'; import Onyx from 'react-native-onyx'; import useHasTeam2025Pricing from '@hooks/useHasTeam2025Pricing'; diff --git a/tests/unit/libs/getClipboardTextTest.ts b/tests/unit/libs/getClipboardTextTest.ts index 15c2480f9aed..a5ffbbbd4477 100644 --- a/tests/unit/libs/getClipboardTextTest.ts +++ b/tests/unit/libs/getClipboardTextTest.ts @@ -2,7 +2,6 @@ import getClipboardText from '@libs/Clipboard/getClipboardText'; import Parser from '@libs/Parser'; jest.mock('@libs/Parser', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { htmlToText: jest.fn(), diff --git a/tests/unit/libs/prepareRequestPayloadNativeTest.ts b/tests/unit/libs/prepareRequestPayloadNativeTest.ts index bb4d15aca3a4..a2dde7955dc0 100644 --- a/tests/unit/libs/prepareRequestPayloadNativeTest.ts +++ b/tests/unit/libs/prepareRequestPayloadNativeTest.ts @@ -2,7 +2,6 @@ import type PrepareRequestPayload from '@libs/prepareRequestPayload/types'; const mockCheckFileExists = jest.fn, [string | undefined]>(); jest.mock('@libs/fileDownload/checkFileExists', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: mockCheckFileExists, })); @@ -12,14 +11,12 @@ jest.mock('@libs/fileDownload/FileUtils', () => ({ })); jest.mock('@libs/validateFormDataParameter', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), })); const mockLogAlert = jest.fn(); jest.mock('@libs/Log', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: {alert: mockLogAlert}, })); diff --git a/tests/unit/libs/receiptDurableStorageTest.ts b/tests/unit/libs/receiptDurableStorageTest.ts index 4d7b76ff0dff..c4270fce7b05 100644 --- a/tests/unit/libs/receiptDurableStorageTest.ts +++ b/tests/unit/libs/receiptDurableStorageTest.ts @@ -6,13 +6,11 @@ jest.mock('react-native-fs', () => ({ const DURABLE_UPLOAD_DIR = '/var/mobile/Documents/Receipts-Upload'; jest.mock('@libs/getReceiptsUploadFolderPath', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => DURABLE_UPLOAD_DIR, })); jest.mock('@libs/Log', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: {warn: jest.fn(), alert: jest.fn()}, })); diff --git a/tests/unit/navigateAfterOnboardingTest.ts b/tests/unit/navigateAfterOnboardingTest.ts index 1d4d2a4fe498..2ed25846302f 100644 --- a/tests/unit/navigateAfterOnboardingTest.ts +++ b/tests/unit/navigateAfterOnboardingTest.ts @@ -44,7 +44,6 @@ jest.mock('@libs/ReportUtils', () => ({ })); jest.mock('@libs/Navigation/helpers/shouldOpenOnAdminRoom', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => mockShouldOpenOnAdminRoom() as boolean, })); diff --git a/tests/unit/navigateToWorkspacesPageTest.ts b/tests/unit/navigateToWorkspacesPageTest.ts index 8fb2259be50a..35c369043acd 100644 --- a/tests/unit/navigateToWorkspacesPageTest.ts +++ b/tests/unit/navigateToWorkspacesPageTest.ts @@ -14,7 +14,6 @@ jest.mock('@libs/Navigation/AppNavigator/createSplitNavigator/usePreserveNavigat jest.mock('@libs/PolicyUtils'); jest.mock('@libs/interceptAnonymousUser'); jest.mock('@libs/Navigation/helpers/getPathFromState', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(), })); diff --git a/tests/unit/reportAttributesTest.ts b/tests/unit/reportAttributesTest.ts index 2839ffcbe3d6..0546d6c6b3c5 100644 --- a/tests/unit/reportAttributesTest.ts +++ b/tests/unit/reportAttributesTest.ts @@ -23,7 +23,6 @@ jest.mock('@libs/ReportUtils', () => ({ })); jest.mock('@libs/SidebarUtils', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention -- Required because Jest mock objects use __esModule which violates the naming convention rule __esModule: true, default: { getReasonAndReportActionThatHasRedBrickRoad: jest.fn(() => undefined), diff --git a/tests/unit/showReportActionNotificationTest.ts b/tests/unit/showReportActionNotificationTest.ts index a7b88a480c95..5366e1f287fa 100644 --- a/tests/unit/showReportActionNotificationTest.ts +++ b/tests/unit/showReportActionNotificationTest.ts @@ -14,7 +14,6 @@ jest.mock('@libs/ActiveClientManager', () => ({ const mockShowModifiedExpenseNotification = jest.fn(); const mockShowCommentNotification = jest.fn(); jest.mock('@libs/Notification/LocalNotification', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { showModifiedExpenseNotification: (...args: unknown[]) => mockShowModifiedExpenseNotification(...args), @@ -25,7 +24,6 @@ jest.mock('@libs/Notification/LocalNotification', () => ({ })); jest.mock('@libs/Navigation/Navigation', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { getTopmostReportId: jest.fn(() => 'other-report-id'), @@ -34,7 +32,6 @@ jest.mock('@libs/Navigation/Navigation', () => ({ })); jest.mock('@libs/Visibility', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: { isVisible: jest.fn(() => false), diff --git a/tests/unit/useReportPreviewSenderIDTest.ts b/tests/unit/useReportPreviewSenderIDTest.ts index b23e7a65227f..fae2cb36167a 100644 --- a/tests/unit/useReportPreviewSenderIDTest.ts +++ b/tests/unit/useReportPreviewSenderIDTest.ts @@ -41,7 +41,6 @@ const optimisticAction = { const CURRENT_USER_EMAIL = 'test@example.com'; const CURRENT_USER_ACCOUNT_ID = 1; jest.mock('@hooks/useCurrentUserPersonalDetails', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => ({ email: CURRENT_USER_EMAIL, diff --git a/tests/unit/useSearchSelectorTest.tsx b/tests/unit/useSearchSelectorTest.tsx index cee5239c1467..31f85775a7f0 100644 --- a/tests/unit/useSearchSelectorTest.tsx +++ b/tests/unit/useSearchSelectorTest.tsx @@ -15,7 +15,6 @@ const EMPTY_OPTIONS = {recentReports: [], personalDetails: [], userToInvite: nul // eslint-disable-next-line @typescript-eslint/no-unsafe-return jest.mock('@libs/OptionsListUtils', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, ...jest.requireActual('@libs/OptionsListUtils'), getValidOptions: jest.fn(() => EMPTY_OPTIONS), diff --git a/tests/unit/useTransactionViolationsTest.ts b/tests/unit/useTransactionViolationsTest.ts index 42e457646d87..04406a332cb5 100644 --- a/tests/unit/useTransactionViolationsTest.ts +++ b/tests/unit/useTransactionViolationsTest.ts @@ -43,7 +43,6 @@ jest.mock('@libs/TransactionUtils', () => { }); jest.mock('@hooks/useCurrentUserPersonalDetails', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: jest.fn(() => ({ email: 'test@example.com', From 1a97b70f762537ab6cf79968d8a573c6530ea826 Mon Sep 17 00:00:00 2001 From: rory Date: Fri, 1 May 2026 15:40:13 -0700 Subject: [PATCH 2/2] Fix lint errors from origin/main merge Co-authored-by: Cursor --- src/components/ReimbursementAccountLoadingIndicator.tsx | 2 +- tests/ui/WorkspaceMoreFeaturesPageTest.tsx | 1 - tests/unit/ReportActionsListHeaderTest.tsx | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/ReimbursementAccountLoadingIndicator.tsx b/src/components/ReimbursementAccountLoadingIndicator.tsx index 65efb45d1332..9d2eee51b87e 100644 --- a/src/components/ReimbursementAccountLoadingIndicator.tsx +++ b/src/components/ReimbursementAccountLoadingIndicator.tsx @@ -21,7 +21,7 @@ function ReimbursementAccountLoadingIndicator({onBackButtonPress}: Reimbursement return ( { }; }); -// eslint-disable-next-line @typescript-eslint/naming-convention jest.mock('@hooks/useIsPolicyConnectedToUberReceiptPartner', () => ({__esModule: true, default: jest.fn(() => false)})); jest.mock('@libs/CardUtils', () => { diff --git a/tests/unit/ReportActionsListHeaderTest.tsx b/tests/unit/ReportActionsListHeaderTest.tsx index 61f6fb2f449f..60b1e30ec365 100644 --- a/tests/unit/ReportActionsListHeaderTest.tsx +++ b/tests/unit/ReportActionsListHeaderTest.tsx @@ -7,7 +7,6 @@ const REPORT_ID = '42'; const mockUseOnyx = jest.fn(); jest.mock('@hooks/useOnyx', () => ({ - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: (key: string) => mockUseOnyx(key), })); @@ -16,7 +15,6 @@ jest.mock('@pages/home/report/ConciergeThinkingMessage', () => { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const {View: MockView} = require('react-native'); return { - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => , }; @@ -26,7 +24,6 @@ jest.mock('@pages/inbox/report/ListBoundaryLoader', () => { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const {View: MockView} = require('react-native'); return { - // eslint-disable-next-line @typescript-eslint/naming-convention __esModule: true, default: () => , };