From c2a5f69adf03b27f982038804828fe848733db67 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 8 Jul 2026 16:51:56 +0100 Subject: [PATCH] Enable some more oxlint rules --- apps/desktop/src/updater.ts | 4 +- apps/web/res/decoder-ring/decoder.js | 6 +- apps/web/src/ContentMessages.ts | 2 +- apps/web/src/LegacyCallHandler.tsx | 32 ++++---- apps/web/src/Lifecycle.ts | 14 ++-- apps/web/src/MatrixClientPeg.ts | 4 +- apps/web/src/MediaDeviceHandler.ts | 10 +-- apps/web/src/Modal.tsx | 8 +- apps/web/src/Notifier.ts | 10 +-- apps/web/src/PosthogAnalytics.ts | 2 +- apps/web/src/Presence.ts | 4 +- apps/web/src/Registration.tsx | 2 +- apps/web/src/ScalarMessaging.ts | 10 +-- apps/web/src/SlidingSyncManager.ts | 2 +- apps/web/src/UserActivity.ts | 4 +- .../eventindex/ManageEventIndexDialog.tsx | 2 +- .../security/CreateSecretStorageDialog.tsx | 8 +- .../dialogs/security/ExportE2eKeysDialog.tsx | 2 +- .../dialogs/security/ImportE2eKeysDialog.tsx | 2 +- .../security/NewRecoveryMethodDialog.tsx | 4 +- apps/web/src/audio/BackgroundAudio.ts | 6 +- apps/web/src/audio/Playback.ts | 2 +- apps/web/src/audio/PlaybackQueue.ts | 6 +- apps/web/src/audio/VoiceRecording.ts | 6 +- .../components/structures/EmbeddedPage.tsx | 2 +- .../src/components/structures/FilePanel.tsx | 2 +- .../components/structures/InteractiveAuth.tsx | 4 +- .../structures/LegacyCallEventGrouper.ts | 5 +- .../components/structures/LoggedInView.tsx | 16 ++-- .../src/components/structures/MatrixChat.tsx | 51 ++++++------ .../structures/NonUrgentToastContainer.tsx | 2 +- .../src/components/structures/RightPanel.tsx | 2 +- .../components/structures/RoomSearchView.tsx | 2 +- .../src/components/structures/RoomView.tsx | 40 +++++----- .../src/components/structures/ScrollPanel.tsx | 8 +- .../components/structures/SpaceRoomView.tsx | 2 +- .../src/components/structures/ThreadPanel.tsx | 3 +- .../src/components/structures/ThreadView.tsx | 2 +- .../components/structures/TimelinePanel.tsx | 16 ++-- .../src/components/structures/UserView.tsx | 4 +- .../structures/auth/ForgotPassword.tsx | 10 +-- .../src/components/structures/auth/Login.tsx | 4 +- .../structures/auth/Registration.tsx | 8 +- .../structures/auth/SetupEncryptionBody.tsx | 6 +- .../components/structures/auth/SoftLogout.tsx | 6 +- .../auth/forgot-password/EnterEmail.tsx | 2 +- .../memberlist/MemberListViewModel.tsx | 16 ++-- .../memberlist/tiles/MemberTileViewModel.tsx | 6 +- .../UserInfoIgnoreButtonViewModel.tsx | 6 +- .../views/audio_messages/AudioPlayerBase.tsx | 2 +- .../views/audio_messages/LegacySeekBar.tsx | 6 +- .../views/audio_messages/Waveform.tsx | 1 + .../views/auth/LanguageSelector.tsx | 2 +- .../components/views/auth/LoginWithQRFlow.tsx | 78 +++++++++++-------- .../components/views/auth/PasswordLogin.tsx | 2 +- .../views/auth/RegistrationForm.tsx | 6 +- .../views/context_menus/DeviceContextMenu.tsx | 4 +- .../context_menus/MessageContextMenu.tsx | 8 +- .../context_menus/RoomGeneralContextMenu.tsx | 4 +- .../views/context_menus/SpaceContextMenu.tsx | 4 +- .../views/dialogs/AskInviteAnywayDialog.tsx | 2 +- .../views/dialogs/BugReportDialog.tsx | 2 +- .../views/dialogs/ChangelogDialog.tsx | 2 +- .../views/dialogs/ConfirmRedactDialog.tsx | 2 +- .../views/dialogs/CreateRoomDialog.tsx | 4 +- .../views/dialogs/CreateSubspaceDialog.tsx | 4 +- .../components/views/dialogs/ExportDialog.tsx | 4 +- .../views/dialogs/FeedbackDialog.tsx | 2 +- .../views/dialogs/ForwardDialog.tsx | 2 +- .../dialogs/GenericFeatureFeedbackDialog.tsx | 2 +- .../views/dialogs/IncomingSasDialog.tsx | 4 +- .../components/views/dialogs/InviteDialog.tsx | 10 +-- .../dialogs/MessageEditHistoryDialog.tsx | 2 +- .../views/dialogs/ModalWidgetDialog.tsx | 6 +- .../dialogs/RegistrationEmailPromptDialog.tsx | 2 +- .../views/dialogs/ServerOfflineDialog.tsx | 6 +- .../views/dialogs/ServerPickerDialog.tsx | 2 +- .../dialogs/SessionRestoreErrorDialog.tsx | 2 +- .../views/dialogs/SetEmailDialog.tsx | 4 +- .../views/dialogs/SpacePreferencesDialog.tsx | 2 +- .../views/dialogs/TextInputDialog.tsx | 2 +- .../dialogs/VerificationRequestDialog.tsx | 2 +- .../WidgetCapabilitiesPromptDialog.tsx | 4 +- .../views/dialogs/devtools/BaseTool.tsx | 2 +- .../views/dialogs/devtools/Event.tsx | 2 +- .../security/AccessSecretStorageDialog.tsx | 2 +- .../security/RestoreKeyBackupDialog.tsx | 4 +- .../dialogs/spotlight/SpotlightDialog.tsx | 9 ++- .../views/directory/NetworkDropdown.tsx | 2 +- .../src/components/views/elements/AppTile.tsx | 6 +- .../views/elements/EffectsOverlay.tsx | 4 +- .../views/elements/ErrorBoundary.tsx | 2 +- .../src/components/views/elements/Field.tsx | 6 +- .../elements/IRCTimelineProfileResizer.tsx | 2 +- .../components/views/elements/ImageView.tsx | 2 +- .../views/elements/PollCreateDialog.tsx | 4 +- .../src/components/views/elements/QRCode.tsx | 2 +- .../components/views/elements/ReplyChain.tsx | 4 +- .../views/elements/ServerPicker.tsx | 2 +- .../views/elements/SettingsDropdown.tsx | 2 +- .../views/emojipicker/ReactionPicker.tsx | 4 +- .../views/location/LocationPicker.tsx | 2 +- .../views/location/LocationShareMenu.tsx | 2 +- .../components/views/messages/CallEvent.tsx | 2 +- .../components/views/messages/CodeBlock.tsx | 2 +- .../components/views/messages/MBeaconBody.tsx | 2 +- .../views/messages/MImageReplyBody.tsx | 1 + .../components/views/messages/MPollBody.tsx | 2 +- .../polls/pollHistory/PollListItemEnded.tsx | 2 +- .../views/polls/pollHistory/fetchPastPolls.ts | 4 +- .../views/polls/pollHistory/usePollHistory.ts | 2 +- .../views/right_panel/EncryptionPanel.tsx | 2 +- .../views/right_panel/ExtensionsCard.tsx | 2 +- .../views/right_panel/PinnedMessagesCard.tsx | 2 +- .../components/views/right_panel/UserInfo.tsx | 6 +- .../views/right_panel/VerificationPanel.tsx | 6 +- .../user_info/UserInfoAdminToolsContainer.tsx | 6 +- .../user_info/UserInfoBasicOptionsView.tsx | 2 +- .../views/room_settings/AliasSettings.tsx | 12 +-- .../room_settings/RoomPublishSetting.tsx | 2 +- .../components/views/rooms/Autocomplete.tsx | 10 ++- .../views/rooms/BasicMessageComposer.tsx | 14 ++-- .../views/rooms/EditMessageComposer.tsx | 4 +- .../src/components/views/rooms/EventTile.tsx | 2 +- .../views/rooms/MessageComposer.tsx | 6 +- .../views/rooms/PinnedMessageBanner.tsx | 1 + .../rooms/RoomHeader/CallGuestLinkButton.tsx | 2 +- .../components/views/rooms/RoomPreviewBar.tsx | 7 +- .../views/rooms/SendMessageComposer.tsx | 10 +-- .../components/views/rooms/Stickerpicker.tsx | 2 +- .../views/rooms/VoiceRecordComposerTile.tsx | 4 +- .../wysiwyg_composer/components/Editor.tsx | 2 + .../hooks/useComposerFunctions.ts | 2 +- .../hooks/useWysiwygEditActionHandler.ts | 4 +- .../hooks/useWysiwygSendActionHandler.ts | 4 +- .../rooms/wysiwyg_composer/utils/message.ts | 2 +- .../views/settings/AddRemoveThreepids.tsx | 4 +- .../views/settings/EventIndexPanel.tsx | 4 +- .../views/settings/ImageSizePanel.tsx | 2 +- .../views/settings/JoinRuleSettings.tsx | 2 +- .../views/settings/LayoutSwitcher.tsx | 2 +- .../views/settings/Notifications.tsx | 6 +- .../components/views/settings/SetIdServer.tsx | 4 +- .../settings/UserPersonalInfoSettings.tsx | 2 +- .../views/settings/UserProfileSettings.tsx | 2 +- .../views/settings/devices/DeviceDetails.tsx | 4 +- .../views/settings/devices/deleteDevices.tsx | 2 +- .../views/settings/devices/useOwnDevices.ts | 6 +- .../settings/discovery/DiscoverySettings.tsx | 4 +- .../settings/encryption/ChangeRecoveryKey.tsx | 2 +- .../settings/encryption/KeyStoragePanel.tsx | 2 +- .../tabs/room/AdvancedRoomSettingsTab.tsx | 2 +- .../tabs/room/NotificationSettingsTab.tsx | 2 +- .../tabs/room/RolesRoomSettingsTab.tsx | 4 +- .../tabs/room/SecurityRoomSettingsTab.tsx | 6 +- .../tabs/room/VoipRoomSettingsTab.tsx | 2 +- .../tabs/user/AccountUserSettingsTab.tsx | 4 +- .../tabs/user/AppearanceUserSettingsTab.tsx | 2 +- .../tabs/user/EncryptionUserSettingsTab.tsx | 2 +- .../tabs/user/HelpUserSettingsTab.tsx | 2 +- .../tabs/user/MediaPreviewAccountSettings.tsx | 2 +- .../tabs/user/PreferencesUserSettingsTab.tsx | 17 ++-- .../tabs/user/SecurityUserSettingsTab.tsx | 6 +- .../settings/tabs/user/SessionManagerTab.tsx | 8 +- .../views/spaces/SpaceCreateMenu.tsx | 9 ++- .../components/views/spaces/SpacePanel.tsx | 7 +- .../views/toasts/VerificationRequestToast.tsx | 4 +- .../verification/VerificationShowSas.tsx | 9 ++- .../src/components/views/voip/AudioFeed.tsx | 6 +- .../voip/AudioFeedArrayForLegacyCall.tsx | 4 +- .../src/components/views/voip/CallView.tsx | 2 +- .../components/views/voip/DialPadModal.tsx | 4 +- .../components/views/voip/LegacyCallView.tsx | 10 +-- .../src/components/views/voip/VideoFeed.tsx | 8 +- .../web/src/device-listener/DeviceListener.ts | 6 +- .../DeviceListenerOtherDevices.ts | 2 +- apps/web/src/editor/operations.ts | 6 +- apps/web/src/emojipicker/recent.ts | 7 +- apps/web/src/hooks/room/useRoomCall.tsx | 4 +- .../src/hooks/spotlight/useRecentSearches.ts | 2 +- apps/web/src/hooks/useAsyncMemo.ts | 2 +- apps/web/src/hooks/useEncryptionStatus.ts | 2 +- apps/web/src/hooks/useEventEmitter.ts | 2 +- apps/web/src/hooks/usePermalinkEvent.ts | 2 +- apps/web/src/hooks/usePermalinkMember.ts | 2 +- apps/web/src/hooks/usePublicRoomDirectory.ts | 2 +- apps/web/src/hooks/useSpaceResults.ts | 4 +- apps/web/src/hooks/useUserStatus.ts | 2 +- apps/web/src/hooks/useUserTimezone.ts | 2 +- apps/web/src/indexing/EventIndex.ts | 4 +- apps/web/src/modules/ProxiedModuleApi.ts | 2 +- apps/web/src/rageshake/rageshake.ts | 4 +- apps/web/src/sendTimePerformanceMetrics.ts | 2 +- apps/web/src/settings/SettingsStore.ts | 8 +- .../InviteRulesConfigController.ts | 2 +- .../handlers/AccountSettingsHandler.ts | 2 +- .../handlers/PlatformSettingsHandler.ts | 2 +- apps/web/src/settings/watchers/FontWatcher.ts | 8 +- apps/web/src/slash-commands/SlashCommands.tsx | 6 +- apps/web/src/slash-commands/utils.ts | 2 +- apps/web/src/stores/BreadcrumbsStore.ts | 2 +- apps/web/src/stores/CallStore.ts | 4 +- apps/web/src/stores/LifecycleStore.ts | 10 +-- apps/web/src/stores/ModalWidgetStore.ts | 6 +- apps/web/src/stores/MultiRoomViewStore.ts | 2 +- apps/web/src/stores/OwnBeaconStore.ts | 22 +++--- apps/web/src/stores/OwnProfileStore.ts | 2 +- apps/web/src/stores/RoomViewStore.tsx | 8 +- apps/web/src/stores/SetupEncryptionStore.ts | 6 +- apps/web/src/stores/TypingStore.ts | 6 +- apps/web/src/stores/VoiceRecordingStore.ts | 4 +- apps/web/src/stores/WidgetStore.ts | 2 +- apps/web/src/stores/local-echo/EchoStore.ts | 2 +- .../message-preview/MessagePreviewStore.ts | 2 +- .../RoomNotificationStateStore.ts | 2 +- .../src/stores/right-panel/RightPanelStore.ts | 6 +- .../stores/room-list-v3/RoomListStoreV3.ts | 4 +- apps/web/src/stores/spaces/SpaceStore.ts | 12 +-- .../src/stores/widgets/WidgetLayoutStore.ts | 4 +- .../web/src/stores/widgets/WidgetMessaging.ts | 8 +- .../stores/widgets/WidgetMessagingStore.ts | 2 +- .../stores/widgets/WidgetPermissionStore.ts | 2 +- apps/web/src/toasts/AnalyticsToast.tsx | 4 +- .../src/toasts/DesktopNotificationsToast.ts | 2 +- apps/web/src/toasts/UpdateToast.tsx | 4 +- apps/web/src/utils/DMRoomMap.ts | 2 +- apps/web/src/utils/DialogOpener.ts | 6 +- apps/web/src/utils/IdentityServerUtils.ts | 2 +- apps/web/src/utils/MultiInviter.ts | 2 +- apps/web/src/utils/ReactUtils.tsx | 2 +- apps/web/src/utils/StorageManager.ts | 2 +- apps/web/src/utils/WidgetUtils.ts | 2 +- .../web/src/utils/device/clientInformation.ts | 2 +- apps/web/src/utils/dm/createDmLocalRoom.ts | 2 +- apps/web/src/utils/leave-behaviour.test.ts | 2 +- apps/web/src/utils/leave-behaviour.ts | 2 +- apps/web/src/utils/promise.ts | 2 +- apps/web/src/utils/space.tsx | 4 +- apps/web/src/vector/jitsi/index.ts | 2 +- .../src/viewmodels/menus/UserMenuViewModel.ts | 2 +- .../message-body/FileBodyViewModel.ts | 8 +- .../message-body/VideoBodyViewModel.ts | 2 +- .../room-list/RoomListHeaderViewModel.ts | 10 +-- .../viewmodels/room-list/RoomListViewModel.ts | 18 ++--- .../room/EventTileActionBarViewModel.ts | 2 +- .../viewmodels/room/RoomUploadViewModel.tsx | 4 +- .../WidgetContextMenuViewModel.tsx | 4 +- .../event-tile/body/AudioPlayerViewModel.ts | 8 +- .../event-tile/body/TextualBodyViewModel.tsx | 4 +- .../body/ViewSourceEventViewModel.ts | 2 +- .../reactions/ReactionsRowButtonViewModel.ts | 4 +- .../viewmodels/structures/ResizerViewModel.ts | 4 +- apps/web/src/widgets/Jitsi.ts | 2 +- .../accessibility/LandmarkNavigation-test.tsx | 36 ++++----- oxlint.config.ts | 13 ++-- .../VirtualizedList/virtualized-list.test.tsx | 1 + .../shared-components/src/core/i18n/i18n.tsx | 2 +- .../src/core/utils/applyReplacerOnString.tsx | 4 +- .../src/crypto/SasEmoji/SasEmoji.tsx | 1 + .../RoomListPrimaryFilters.tsx | 4 +- 260 files changed, 686 insertions(+), 636 deletions(-) diff --git a/apps/desktop/src/updater.ts b/apps/desktop/src/updater.ts index e6702d38c58..d7e6da788d0 100644 --- a/apps/desktop/src/updater.ts +++ b/apps/desktop/src/updater.ts @@ -147,7 +147,7 @@ async function available(): Promise { if (major < 21) { // If the macOS version is too old for modern Electron support then disable auto update to prevent the app updating and bricking itself. // The oldest macOS version supported by Chromium/Electron 38 is Monterey (12.x) which started with Darwin 21.0 - initialisePromise.then(() => { + await initialisePromise.then(() => { ipcMain.emit("showToast", { title: _t("eol|title"), description: _t("eol|no_more_updates", { brand: getConfig().brand }), @@ -158,7 +158,7 @@ async function available(): Promise { } else if (major < 22) { // If the macOS version is EOL then show a warning message. // The oldest macOS version still supported by Apple is Ventura (13.x) which started with Darwin 22.0 - initialisePromise.then(() => { + await initialisePromise.then(() => { ipcMain.emit("showToast", { title: _t("eol|title"), description: _t("eol|warning", { brand: getConfig().brand }), diff --git a/apps/web/res/decoder-ring/decoder.js b/apps/web/res/decoder-ring/decoder.js index 866ff8be85b..3c3dfd278a6 100644 --- a/apps/web/res/decoder-ring/decoder.js +++ b/apps/web/res/decoder-ring/decoder.js @@ -40,8 +40,8 @@ function bundleSubject(baseUrl, bundle) { const fetcher = new rxjs.BehaviorSubject(Pending.of()); bundleCache.set(bundle, fetcher); - fetch(new URL(`bundles/${bundle}/bundle.js.map`, baseUrl).toString()).then((res) => { - res.body.cancel(); /* Bail on the download immediately - it could be big! */ + void fetch(new URL(`bundles/${bundle}/bundle.js.map`, baseUrl).toString()).then((res) => { + void res.body.cancel(); /* Bail on the download immediately - it could be big! */ const status = res.ok; if (status) { fetcher.next(Success.of()); @@ -100,7 +100,7 @@ function fetchAsSubject(endpoint) { const fetcher = new rxjs.BehaviorSubject(Pending.of()); fetchCache.set(endpoint, fetcher); - fetch(endpoint).then((res) => { + void fetch(endpoint).then((res) => { if (!res.ok) { fetcher.next(FetchError.of(`Failed to fetch endpoint ${endpoint}: ${res.status} ${res.statusText}`)); return; diff --git a/apps/web/src/ContentMessages.ts b/apps/web/src/ContentMessages.ts index 601027c6916..fdb5baad6c5 100644 --- a/apps/web/src/ContentMessages.ts +++ b/apps/web/src/ContentMessages.ts @@ -271,7 +271,7 @@ function loadVideoElement(videoFile: File): Promise { video.src = dataUrl; video.load(); - video.play(); + void video.play(); }; reader.onerror = function (e): void { reject(e); diff --git a/apps/web/src/LegacyCallHandler.tsx b/apps/web/src/LegacyCallHandler.tsx index 48627d59ad0..1846b863e16 100644 --- a/apps/web/src/LegacyCallHandler.tsx +++ b/apps/web/src/LegacyCallHandler.tsx @@ -142,7 +142,7 @@ export default class LegacyCallHandler extends TypedEventEmitter { - this.checkProtocols(maxTries - 1); + void this.checkProtocols(maxTries - 1); }, 10000); } } @@ -506,14 +506,14 @@ export default class LegacyCallHandler extends TypedEventEmitter { - SettingsStore.setValue("fallbackICEServerAllowed", null, SettingLevel.DEVICE, allow ?? null); + void finished.then(([allow]) => { + void SettingsStore.setValue("fallbackICEServerAllowed", null, SettingLevel.DEVICE, allow ?? null); }); } @@ -733,9 +733,9 @@ export default class LegacyCallHandler extends TypedEventEmitter({ action: Action.ViewRoom, @@ -886,7 +886,7 @@ export default class LegacyCallHandler extends TypedEventEmitter({ action: Action.ViewRoom, room_id: dmRoomId, @@ -1004,7 +1004,7 @@ export default class LegacyCallHandler extends TypedEventEmitter { if (payload.action === Action.TriggerLogout) { // noinspection JSIgnoredPromiseFromCall - we don't care if it fails - onLoggedOut(); + void onLoggedOut(); } else if (payload.action === Action.OverwriteLogin) { const typed = payload; // Stop the current client before overwriting the login. @@ -483,7 +483,7 @@ function onFailedDelegatedAuthLogin(description: string | ReactNode, tryAgain?: button: _t("action|try_again"), }); - finished.then(([shouldTryAgain]) => { + void finished.then(([shouldTryAgain]) => { // if we have a tryAgain callback, call it the primary 'try again' button was clicked in the dialog if (shouldTryAgain) tryAgain?.(); }); @@ -968,7 +968,7 @@ export async function logout(): Promise { } _isLoggingOut = true; - PlatformPeg.get()?.destroyPickleKey(client.getSafeUserId(), client.getDeviceId() ?? ""); + await PlatformPeg.get()?.destroyPickleKey(client.getSafeUserId(), client.getDeviceId() ?? ""); doLogout(client, oauth ?? null).then(onLoggedOut, (err) => { // Just throwing an error here is going to be very unhelpful @@ -979,7 +979,7 @@ export async function logout(): Promise { // tokens expire (and if you really think you've been compromised, // change your password). logger.warn("Failed to call logout API: token will not be invalidated", err); - onLoggedOut(); + void onLoggedOut(); }); } @@ -1075,7 +1075,7 @@ async function startMatrixClient( // Similarly, don't start sending presence updates until we've started // the client if (!SettingsStore.getValue("lowBandwidth")) { - Presence.start(); + void Presence.start(); } // Now that we have a MatrixClientPeg, update the Jitsi info @@ -1193,8 +1193,8 @@ export function stopMatrixClient(unsetClient = true): void { if (unsetClient) { MatrixClientPeg.unset(); - EventIndexPeg.unset(); - cli.store.destroy(); + void EventIndexPeg.unset(); + void cli.store.destroy(); } } } diff --git a/apps/web/src/MatrixClientPeg.ts b/apps/web/src/MatrixClientPeg.ts index 03d47b0a335..0df868dbc1e 100644 --- a/apps/web/src/MatrixClientPeg.ts +++ b/apps/web/src/MatrixClientPeg.ts @@ -199,7 +199,7 @@ class MatrixClientPegClass implements IMatrixClientPeg { private onUnexpectedStoreClose = async (): Promise => { if (!this.matrixClient) return; this.matrixClient.stopClient(); // stop the client as the database has failed - this.matrixClient.store.destroy(); + void this.matrixClient.store.destroy(); if (!this.matrixClient.isGuest()) { // If the user is not a guest then prompt them to reload rather than doing it for them @@ -278,7 +278,7 @@ class MatrixClientPegClass implements IMatrixClientPeg { if (SettingsStore.getValue("feature_simplified_sliding_sync")) { opts.slidingSync = await SlidingSyncManager.instance.setup(this.matrixClient); } else { - SlidingSyncManager.instance.checkSupport(this.matrixClient); + void SlidingSyncManager.instance.checkSupport(this.matrixClient); } // Connect the matrix client to the dispatcher and setting handlers diff --git a/apps/web/src/MediaDeviceHandler.ts b/apps/web/src/MediaDeviceHandler.ts index c77fd87377a..b5e7ce4870f 100644 --- a/apps/web/src/MediaDeviceHandler.ts +++ b/apps/web/src/MediaDeviceHandler.ts @@ -106,7 +106,7 @@ export default class MediaDeviceHandler extends EventEmitter { } public setAudioOutput(deviceId: string): void { - SettingsStore.setValue("webrtc_audiooutput", null, SettingLevel.DEVICE, deviceId); + void SettingsStore.setValue("webrtc_audiooutput", null, SettingLevel.DEVICE, deviceId); this.emit(MediaDeviceHandlerEvent.AudioOutputChanged, deviceId); } @@ -116,7 +116,7 @@ export default class MediaDeviceHandler extends EventEmitter { * @param {string} deviceId */ public async setAudioInput(deviceId: string): Promise { - SettingsStore.setValue("webrtc_audioinput", null, SettingLevel.DEVICE, deviceId); + void SettingsStore.setValue("webrtc_audioinput", null, SettingLevel.DEVICE, deviceId); return MatrixClientPeg.safeGet().getMediaHandler().setAudioInput(deviceId); } @@ -126,7 +126,7 @@ export default class MediaDeviceHandler extends EventEmitter { * @param {string} deviceId */ public async setVideoInput(deviceId: string): Promise { - SettingsStore.setValue("webrtc_videoinput", null, SettingLevel.DEVICE, deviceId); + void SettingsStore.setValue("webrtc_videoinput", null, SettingLevel.DEVICE, deviceId); return MatrixClientPeg.safeGet().getMediaHandler().setVideoInput(deviceId); } @@ -203,13 +203,13 @@ export default class MediaDeviceHandler extends EventEmitter { return SettingsStore.getValue("audioInputMuted"); } public static set startWithAudioMuted(value: boolean) { - SettingsStore.setValue("audioInputMuted", null, SettingLevel.DEVICE, value); + void SettingsStore.setValue("audioInputMuted", null, SettingLevel.DEVICE, value); } public static get startWithVideoMuted(): boolean { return SettingsStore.getValue("videoInputMuted"); } public static set startWithVideoMuted(value: boolean) { - SettingsStore.setValue("videoInputMuted", null, SettingLevel.DEVICE, value); + void SettingsStore.setValue("videoInputMuted", null, SettingLevel.DEVICE, value); } } diff --git a/apps/web/src/Modal.tsx b/apps/web/src/Modal.tsx index 313818af464..c2b538f8eb4 100644 --- a/apps/web/src/Modal.tsx +++ b/apps/web/src/Modal.tsx @@ -212,7 +212,7 @@ export class ModalManager extends TypedEventEmitter { + void plaf.requestNotificationPermission().then((result) => { if (result !== "granted") { // The permission request was dismissed or denied // TODO: Support alternative branding in messaging @@ -490,7 +490,7 @@ export default class Notifier extends TypedEventEmitter { - this.updateAnonymityFromSettings(client, !!newValue); + void this.updateAnonymityFromSettings(client, !!newValue); }, ); } diff --git a/apps/web/src/Presence.ts b/apps/web/src/Presence.ts index 7ccafdf68c5..0af25261857 100644 --- a/apps/web/src/Presence.ts +++ b/apps/web/src/Presence.ts @@ -36,7 +36,7 @@ class Presence { while (this.unavailableTimer) { try { await this.unavailableTimer.finished(); - this.setState(SetPresence.Unavailable); + await this.setState(SetPresence.Unavailable); } catch { /* aborted, stop got called */ } @@ -63,7 +63,7 @@ class Presence { private onAction = (payload: ActionPayload): void => { if (payload.action === Action.UserActivity) { - this.setState(SetPresence.Online); + void this.setState(SetPresence.Online); this.unavailableTimer?.restart(); } }; diff --git a/apps/web/src/Registration.tsx b/apps/web/src/Registration.tsx index 22eb6e15ff5..da61a6c41f1 100644 --- a/apps/web/src/Registration.tsx +++ b/apps/web/src/Registration.tsx @@ -63,7 +63,7 @@ export async function startAnyRegistrationFlow( ] : [], }); - modal.finished.then(([proceed]) => { + void modal.finished.then(([proceed]) => { if (proceed) { dis.dispatch({ action: "start_login", screenAfterLogin: options.screen_after }); } else if (options.go_home_on_cancel) { diff --git a/apps/web/src/ScalarMessaging.ts b/apps/web/src/ScalarMessaging.ts index 20858b5d1ce..1e441f5ef7b 100644 --- a/apps/web/src/ScalarMessaging.ts +++ b/apps/web/src/ScalarMessaging.ts @@ -895,7 +895,7 @@ const onMessage = function (event: MessageEvent): void { setWidget(event, null); return; } else if (event.data.action === Action.GetOpenIdToken) { - getOpenIdToken(event); + void getOpenIdToken(event); return; } else { sendError(event, _t("scalar|error_missing_room_id_request")); @@ -928,16 +928,16 @@ const onMessage = function (event: MessageEvent): void { getMembershipCount(event, roomId); return; } else if (event.data.action === Action.GetRoomEncryptionState) { - getRoomEncState(event, roomId); + void getRoomEncState(event, roomId); return; } else if (event.data.action === Action.CanSendEvent) { canSendEvent(event, roomId); return; } else if (event.data.action === Action.SendEvent) { - sendEvent(event, roomId); + void sendEvent(event, roomId); return; } else if (event.data.action === Action.ReadEvents) { - readEvents(event, roomId); + void readEvents(event, roomId); return; } @@ -962,7 +962,7 @@ const onMessage = function (event: MessageEvent): void { setBotOptions(event, roomId, userId); break; case Action.SetBotPower: - setBotPower(event, roomId, userId, event.data.level, event.data.ignoreIfGreater); + void setBotPower(event, roomId, userId, event.data.level, event.data.ignoreIfGreater); break; default: logger.warn("Unhandled postMessage event with action '" + event.data.action + "'"); diff --git a/apps/web/src/SlidingSyncManager.ts b/apps/web/src/SlidingSyncManager.ts index e92bf83fa0a..3ba22b8298c 100644 --- a/apps/web/src/SlidingSyncManager.ts +++ b/apps/web/src/SlidingSyncManager.ts @@ -384,7 +384,7 @@ export class SlidingSyncManager { public async setup(client: MatrixClient): Promise { const slidingSync = this.configure(client, client.baseUrl); logger.info("Simplified Sliding Sync activated at", client.baseUrl); - this.startSpidering(slidingSync, 50, 50); // 50 rooms at a time, 50ms apart + void this.startSpidering(slidingSync, 50, 50); // 50 rooms at a time, 50ms apart return slidingSync; } diff --git a/apps/web/src/UserActivity.ts b/apps/web/src/UserActivity.ts index 61f786e861e..fcaa306d7e2 100644 --- a/apps/web/src/UserActivity.ts +++ b/apps/web/src/UserActivity.ts @@ -194,7 +194,7 @@ export default class UserActivity { dis.dispatch({ action: Action.UserActivity }); if (!this.activeNowTimeout.isRunning()) { this.activeNowTimeout.start(); - UserActivity.runTimersUntilTimeout(this.attachedActiveNowTimers, this.activeNowTimeout); + void UserActivity.runTimersUntilTimeout(this.attachedActiveNowTimers, this.activeNowTimeout); } else { this.activeNowTimeout.restart(); } @@ -202,7 +202,7 @@ export default class UserActivity { if (!this.activeRecentlyTimeout.isRunning()) { this.activeRecentlyTimeout.start(); - UserActivity.runTimersUntilTimeout(this.attachedActiveRecentlyTimers, this.activeRecentlyTimeout); + void UserActivity.runTimersUntilTimeout(this.attachedActiveRecentlyTimers, this.activeRecentlyTimeout); } else { this.activeRecentlyTimeout.restart(); } diff --git a/apps/web/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx b/apps/web/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx index a7ac7f570d6..cf7aeca4f17 100644 --- a/apps/web/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx +++ b/apps/web/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx @@ -122,7 +122,7 @@ export default class ManageEventIndexDialog extends React.Component): void => { this.setState({ crawlerSleepTime: parseInt(e.target.value, 10) }); - SettingsStore.setValue("crawlerSleepTime", null, SettingLevel.DEVICE, e.target.valueAsNumber); + void SettingsStore.setValue("crawlerSleepTime", null, SettingLevel.DEVICE, e.target.valueAsNumber); }; public render(): React.ReactNode { diff --git a/apps/web/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx b/apps/web/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx index dc7d77dbe65..aa43e97f723 100644 --- a/apps/web/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx +++ b/apps/web/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx @@ -117,7 +117,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent): void => { @@ -268,11 +268,11 @@ export default class CreateSecretStorageDialog extends React.PureComponent { - this.bootstrapSecretStorage(); + void this.bootstrapSecretStorage(); }; private onShowKeyContinueClick = (): void => { - this.bootstrapSecretStorage(); + void this.bootstrapSecretStorage(); }; private onCancelClick = (): void => { @@ -290,7 +290,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent // Focus on the first invalid field, then re-validate, // which will result in the error tooltip being displayed for that field. invalidFields[0].focus(); - invalidFields[0].validate({ allowEmpty: false, focused: true }); + await invalidFields[0].validate({ allowEmpty: false, focused: true }); return false; } diff --git a/apps/web/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx b/apps/web/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx index fff841d8a67..a5c5a01b5c1 100644 --- a/apps/web/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx +++ b/apps/web/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx @@ -88,7 +88,7 @@ export default class ImportE2eKeysDialog extends React.Component // noinspection JSIgnoredPromiseFromCall const file = this.file.current?.files?.[0]; if (file) { - this.startImport(file, this.state.passphrase); + void this.startImport(file, this.state.passphrase); } return false; }; diff --git a/apps/web/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx b/apps/web/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx index de3583fef9b..7664528358d 100644 --- a/apps/web/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx +++ b/apps/web/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx @@ -43,7 +43,7 @@ export default function NewRecoveryMethodDialog({ onFinished }: NewRecoveryMetho setIsKeyBackupEnabled(Boolean(crypto && (await crypto.getActiveSessionBackupVersion()) !== null)); }; - checkBackupEnabled(); + void checkBackupEnabled(); }, [matrixClient]); function onClick(): void { @@ -51,7 +51,7 @@ export default function NewRecoveryMethodDialog({ onFinished }: NewRecoveryMetho onFinished(); } else { const { finished } = Modal.createDialog(RestoreKeyBackupDialog, {}, undefined, false, true); - finished.then(onFinished); + void finished.then(onFinished); } } diff --git a/apps/web/src/audio/BackgroundAudio.ts b/apps/web/src/audio/BackgroundAudio.ts index eda10c0904d..c70b8714648 100644 --- a/apps/web/src/audio/BackgroundAudio.ts +++ b/apps/web/src/audio/BackgroundAudio.ts @@ -19,9 +19,9 @@ export class BackgroundAudio { private audioContext = createAudioContext(); private sounds: Record = {}; - public async pickFormatAndPlay>( + public async pickFormatAndPlay( urlPrefix: string, - formats: F, + formats: Array, loop = false, ): Promise { const format = this.pickFormat(...formats); @@ -51,7 +51,7 @@ export class BackgroundAudio { await this.audioContext.resume(); source.onended = () => { - this.audioContext.suspend(); + void this.audioContext.suspend(); }; source.start(); diff --git a/apps/web/src/audio/Playback.ts b/apps/web/src/audio/Playback.ts index fa0bceffdf9..ebfb7c86f7e 100644 --- a/apps/web/src/audio/Playback.ts +++ b/apps/web/src/audio/Playback.ts @@ -129,7 +129,7 @@ export class Playback extends EventEmitter implements IDestroyable, PlaybackInte // Dev note: It's critical that we call stop() during cleanup to ensure that downstream callers // are aware of the final clock position before the user triggered an unload. // noinspection JSIgnoredPromiseFromCall - not concerned about being called async here - this.stop(); + void this.stop(); this.removeAllListeners(); this.clock.destroy(); this.waveformObservable.close(); diff --git a/apps/web/src/audio/PlaybackQueue.ts b/apps/web/src/audio/PlaybackQueue.ts index 025c9d25874..d4e27bdd3d4 100644 --- a/apps/web/src/audio/PlaybackQueue.ts +++ b/apps/web/src/audio/PlaybackQueue.ts @@ -113,7 +113,7 @@ export class PlaybackQueue { if (newState === PlaybackState.Stopped && currentClockState !== undefined && !wasLastPlaying) { // noinspection JSIgnoredPromiseFromCall - playback.skipTo(currentClockState); + void playback.skipTo(currentClockState); } else if (newState === PlaybackState.Stopped) { // Remove the now-useless clock for some space savings this.clockStates.delete(mxEvent.getId()!); @@ -138,7 +138,7 @@ export class PlaybackQueue { // This should cause a Play event, which will re-populate our playback order // and update our current playback ID. // noinspection JSIgnoredPromiseFromCall - instance.play(); + void instance.play(); } } else { // else no explicit next event, so find an event we haven't played that comes next. The live @@ -182,7 +182,7 @@ export class PlaybackQueue { // This should cause a Play event, which will re-populate our playback order // and update our current playback ID. // noinspection JSIgnoredPromiseFromCall - instance?.play(); + void instance?.play(); } } } else { diff --git a/apps/web/src/audio/VoiceRecording.ts b/apps/web/src/audio/VoiceRecording.ts index ea8ca96e4ef..1ae2aa31f5a 100644 --- a/apps/web/src/audio/VoiceRecording.ts +++ b/apps/web/src/audio/VoiceRecording.ts @@ -192,7 +192,7 @@ export class VoiceRecording extends EventEmitter implements IDestroyable { if (this.recorder) this.recorder.close(); if (this.recorderContext) { // noinspection ES6MissingAwait - not important that we wait - this.recorderContext.close(); + void this.recorderContext.close(); } throw e; // rethrow so upstream can handle it @@ -244,7 +244,7 @@ export class VoiceRecording extends EventEmitter implements IDestroyable { if (secondsLeft < 0) { // go over to make sure we definitely capture that last frame // noinspection JSIgnoredPromiseFromCall - we aren't concerned with it overlapping - this.stop(); + void this.stop(); } else if (secondsLeft <= TARGET_WARN_TIME_LEFT) { Singleflight.for(this, "ending_soon").do(() => { this.emit(RecordingState.EndingSoon, { secondsLeft }); @@ -306,7 +306,7 @@ export class VoiceRecording extends EventEmitter implements IDestroyable { public destroy(): void { // noinspection JSIgnoredPromiseFromCall - not concerned about stop() being called async here - this.stop(); + void this.stop(); this.removeAllListeners(); this.onDataAvailable = undefined; Singleflight.forgetAllFor(this); diff --git a/apps/web/src/components/structures/EmbeddedPage.tsx b/apps/web/src/components/structures/EmbeddedPage.tsx index 4f2bd2f6a62..ac46241b8c9 100644 --- a/apps/web/src/components/structures/EmbeddedPage.tsx +++ b/apps/web/src/components/structures/EmbeddedPage.tsx @@ -101,7 +101,7 @@ export default class EmbeddedPage extends React.PureComponent { // We use fetch to inline the page into the react component // so that it can inherit CSS and theming easily rather than mess around // with iframes and trying to synchronise document.stylesheets. - this.fetchEmbed(); + void this.fetchEmbed(); this.dispatcherRef = dis.register(this.onAction); } diff --git a/apps/web/src/components/structures/FilePanel.tsx b/apps/web/src/components/structures/FilePanel.tsx index 0cecad0a3e1..9c4dd549bd3 100644 --- a/apps/web/src/components/structures/FilePanel.tsx +++ b/apps/web/src/components/structures/FilePanel.tsx @@ -75,7 +75,7 @@ class FilePanel extends React.Component { if (toStartOfTimeline || !data || !data.liveEvent || ev.isRedacted()) return; const client = MatrixClientPeg.safeGet(); - client.decryptEventIfNeeded(ev); + void client.decryptEventIfNeeded(ev); if (ev.isBeingDecrypted()) { this.decryptingEvents.add(ev.getId()!); diff --git a/apps/web/src/components/structures/InteractiveAuth.tsx b/apps/web/src/components/structures/InteractiveAuth.tsx index 7a414034105..7a985974a5f 100644 --- a/apps/web/src/components/structures/InteractiveAuth.tsx +++ b/apps/web/src/components/structures/InteractiveAuth.tsx @@ -128,7 +128,7 @@ export default class InteractiveAuthComponent extends React.Component { - this.authLogic.poll(); + void this.authLogic.poll(); }, 2000); } @@ -237,7 +237,7 @@ export default class InteractiveAuthComponent extends React.Component { - this.authLogic.submitAuthDict(authData); + void this.authLogic.submitAuthDict(authData); }; private onPhaseChange = (newPhase: number): void => { diff --git a/apps/web/src/components/structures/LegacyCallEventGrouper.ts b/apps/web/src/components/structures/LegacyCallEventGrouper.ts index 28b44ea8a08..719965750c5 100644 --- a/apps/web/src/components/structures/LegacyCallEventGrouper.ts +++ b/apps/web/src/components/structures/LegacyCallEventGrouper.ts @@ -157,7 +157,10 @@ export default class LegacyCallEventGrouper extends EventEmitter { public callBack = (): void => { const roomId = this.roomId; if (!roomId) return; - SDKContextClass.instance.legacyCallHandler.placeCall(roomId, this.isVoice ? CallType.Voice : CallType.Video); + void SDKContextClass.instance.legacyCallHandler.placeCall( + roomId, + this.isVoice ? CallType.Voice : CallType.Video, + ); }; public toggleSilenced = (): void => { diff --git a/apps/web/src/components/structures/LoggedInView.tsx b/apps/web/src/components/structures/LoggedInView.tsx index 10dad82d1c5..bad10f5ad86 100644 --- a/apps/web/src/components/structures/LoggedInView.tsx +++ b/apps/web/src/components/structures/LoggedInView.tsx @@ -144,7 +144,7 @@ class LoggedInView extends React.Component { // stash the MatrixClient in case we log out before we are unmounted this._matrixClient = this.props.matrixClient; - MediaDeviceHandler.loadDevices(); + void MediaDeviceHandler.loadDevices(); this._roomView = React.createRef(); } @@ -153,11 +153,11 @@ class LoggedInView extends React.Component { document.addEventListener("keydown", this.onNativeKeyDown, false); this.context.legacyCallHandler.addListener(LegacyCallHandlerEvent.CallState, this.onCallState); - this.updateServerNoticeEvents(); + void this.updateServerNoticeEvents(); this._matrixClient.on(ClientEvent.AccountData, this.onAccountData); // check push rules on start up as well - monitorSyncedPushRules(this._matrixClient.getAccountData(EventType.PushRules), this._matrixClient); + void monitorSyncedPushRules(this._matrixClient.getAccountData(EventType.PushRules), this._matrixClient); this._matrixClient.on(ClientEvent.Sync, this.onSync); // Call `onSync` with the current state as well this.onSync(this._matrixClient.getSyncState(), null, this._matrixClient.getSyncStateData() ?? undefined); @@ -184,7 +184,7 @@ class LoggedInView extends React.Component { void this.onTimezoneUpdate(); OwnProfileStore.instance.on(UPDATE_EVENT, this.refreshBackgroundImage); - this.refreshBackgroundImage(); + void this.refreshBackgroundImage(); } private getResizerViewModel(): ResizerViewModel { @@ -269,7 +269,7 @@ class LoggedInView extends React.Component { if (event.getType() === "m.ignored_user_list") { dis.dispatch({ action: "ignore_state_changed" }); } - monitorSyncedPushRules(event, this._matrixClient); + void monitorSyncedPushRules(event, this._matrixClient); }; private onCompactLayoutChanged = (): void => { @@ -289,7 +289,7 @@ class LoggedInView extends React.Component { }); if (oldSyncState === SyncState.Prepared && syncState === SyncState.Syncing) { - this.updateServerNoticeEvents(); + void this.updateServerNoticeEvents(); } else { this.calculateServerLimitToast(syncErrorData, this.state.usageLimitEventContent); } @@ -298,7 +298,7 @@ class LoggedInView extends React.Component { private onRoomStateEvents = (ev: MatrixEvent): void => { const serverNoticeList = RoomListStoreV3.instance.getServerNoticeRooms(); if (serverNoticeList.some((r) => r.roomId === ev.getRoomId())) { - this.updateServerNoticeEvents(); + void this.updateServerNoticeEvents(); } }; @@ -549,7 +549,7 @@ class LoggedInView extends React.Component { undefined, false, ); - SettingsStore.setValue( + void SettingsStore.setValue( "showHiddenEventsInTimeline", null, SettingLevel.DEVICE, diff --git a/apps/web/src/components/structures/MatrixChat.tsx b/apps/web/src/components/structures/MatrixChat.tsx index 5e43babbc80..3dc8e740ad2 100644 --- a/apps/web/src/components/structures/MatrixChat.tsx +++ b/apps/web/src/components/structures/MatrixChat.tsx @@ -328,7 +328,7 @@ export default class MatrixChat extends React.PureComponent { // When the session loads it'll be detected as soft logged out and a dispatch // will be sent out to say that, triggering this MatrixChat to show the soft // logout page. - Lifecycle.loadSession({ abortSignal: this.loadSessionAbortController.signal }); + await Lifecycle.loadSession({ abortSignal: this.loadSessionAbortController.signal }); return; } @@ -455,12 +455,7 @@ export default class MatrixChat extends React.PureComponent { this.setState({ pendingInitialSync: false }); } - public setState( - state: - | ((prevState: Readonly, props: Readonly) => Pick | IState | null) - | (Pick | IState | null), - callback?: () => void, - ): void { + public setState(state: Pick | IState | null, callback?: () => void): void { if (state && "view" in state) { logger.debug(`MatrixChat: Queuing change of view from ${Views[this.state.view]} to ${Views[state.view]}`); } @@ -484,9 +479,9 @@ export default class MatrixChat extends React.PureComponent { this.fontWatcher = new FontWatcher(); this.themeWatcher.start(); this.themeWatcher.on(ThemeWatcherEvent.Change, setTheme); - this.fontWatcher.start(); + void this.fontWatcher.start(); - initSentry(SdkConfig.get("sentry")); + void initSentry(SdkConfig.get("sentry")); window.addEventListener("resize", this.onWindowResized); // Once we start loading the MatrixClient, we can't stop, even if MatrixChat gets unmounted (as it does @@ -691,15 +686,15 @@ export default class MatrixChat extends React.PureComponent { break; case "logout": this.stores.legacyCallHandler.hangupAllCalls(); - Promise.all([...CallStore.instance.connectedCalls].map((call) => call.disconnect())).finally(() => + void Promise.all([...CallStore.instance.connectedCalls].map((call) => call.disconnect())).finally(() => Lifecycle.logout(), ); break; case "require_registration": - startAnyRegistrationFlow(payload as any); + void startAnyRegistrationFlow(payload as any); break; case "start_mobile_registration": - this.startRegistration(payload.params || {}, true); + void this.startRegistration(payload.params || {}, true); break; case "start_registration": if (Lifecycle.isSoftLogout()) { @@ -710,7 +705,7 @@ export default class MatrixChat extends React.PureComponent { if (payload.screenAfterLogin) { this.screenAfterLogin = payload.screenAfterLogin; } - this.startRegistration(payload.params || {}); + void this.startRegistration(payload.params || {}); break; case "start_login": if (Lifecycle.isSoftLogout()) { @@ -731,7 +726,7 @@ export default class MatrixChat extends React.PureComponent { } break; case "start_chat": - createRoom(MatrixClientPeg.safeGet(), { + void createRoom(MatrixClientPeg.safeGet(), { dmUserId: payload.user_id, }); break; @@ -742,7 +737,7 @@ export default class MatrixChat extends React.PureComponent { this.forgetRoom(payload.room_id); break; case "copy_room": - this.copyRoom(payload.room_id); + void this.copyRoom(payload.room_id); break; case "view_user_info": this.viewUser(payload.userId, payload.subAction); @@ -754,7 +749,7 @@ export default class MatrixChat extends React.PureComponent { event.getRoomId() === this.state.currentRoomId ) { // re-view the current room so we can update alias/id in the URL properly - this.viewRoom({ + void this.viewRoom({ action: Action.ViewRoom, room_id: this.state.currentRoomId, metricsTrigger: undefined, // room doesn't change @@ -769,7 +764,7 @@ export default class MatrixChat extends React.PureComponent { // to them, supply the room alias. If both are supplied, the room ID will be ignored. const promise = this.viewRoom(payload as ViewRoomPayload); if (payload.deferred_action) { - promise.then(() => { + void promise.then(() => { dis.dispatch(payload.deferred_action); }); } @@ -794,7 +789,7 @@ export default class MatrixChat extends React.PureComponent { break; } case Action.CreateRoom: - this.createRoom(payload.public, payload.defaultName, payload.type); + void this.createRoom(payload.public, payload.defaultName, payload.type); // View the welcome or home page if we need something to look at this.viewSomethingBehindModal(); @@ -907,11 +902,11 @@ export default class MatrixChat extends React.PureComponent { break; case Action.PseudonymousAnalyticsAccept: hideAnalyticsToast(); - SettingsStore.setValue("pseudonymousAnalyticsOptIn", null, SettingLevel.ACCOUNT, true); + void SettingsStore.setValue("pseudonymousAnalyticsOptIn", null, SettingLevel.ACCOUNT, true); break; case Action.PseudonymousAnalyticsReject: hideAnalyticsToast(); - SettingsStore.setValue("pseudonymousAnalyticsOptIn", null, SettingLevel.ACCOUNT, false); + void SettingsStore.setValue("pseudonymousAnalyticsOptIn", null, SettingLevel.ACCOUNT, false); break; case Action.ShowThread: { const { rootEvent, initialEvent, highlighted, scrollIntoView, push } = payload as ShowThreadPayload; @@ -1032,7 +1027,7 @@ export default class MatrixChat extends React.PureComponent { // Only the critical ones for a typical UI are // This will start the decryption process for all events when a // user views a room - room.decryptAllEvents(); + void room.decryptAllEvents(); const theAlias = Rooms.getDisplayAliasForRoom(room); if (theAlias) { presentedId = theAlias; @@ -1126,7 +1121,7 @@ export default class MatrixChat extends React.PureComponent { private viewUser(userId: string, subAction: string): void { // Wait for the first sync so that `getRoom` gives us a room object if it's // in the sync response - this.firstSyncPromise.promise.then(() => { + void this.firstSyncPromise.promise.then(() => { if (subAction === "chat") { this.chatCreateOrReuse(userId); return; @@ -1139,7 +1134,7 @@ export default class MatrixChat extends React.PureComponent { private viewShare(format: ShareFormat, msg: string): void { // Wait for the first sync so we can present possible rooms to share into - this.firstSyncPromise.promise.then(() => { + void this.firstSyncPromise.promise.then(() => { this.notifyNewScreen("share"); let rawEvent; switch (format) { @@ -1198,7 +1193,7 @@ export default class MatrixChat extends React.PureComponent { const [shouldCreate, opts] = await modal.finished; if (shouldCreate) { - createRoom(MatrixClientPeg.safeGet(), opts!); + await createRoom(MatrixClientPeg.safeGet(), opts!); } } @@ -1315,7 +1310,7 @@ export default class MatrixChat extends React.PureComponent { danger: warnings.length > 0, }); - finished.then(async ([shouldLeave]) => { + void finished.then(async ([shouldLeave]) => { if (shouldLeave) { await leaveRoomBehaviour(cli, roomId); @@ -1627,7 +1622,7 @@ export default class MatrixChat extends React.PureComponent { } // Re-apply theme now that account data (including custom_themes) is loaded, otherwise we might end up with the wrong theme applied if the user has custom themes enabled - setTheme(); + void setTheme(); this.firstSyncComplete = true; this.firstSyncPromise.resolve(); @@ -1683,7 +1678,7 @@ export default class MatrixChat extends React.PureComponent { undefined, true, ); - finished.then(([confirmed]) => { + void finished.then(([confirmed]) => { if (confirmed) { const wnd = window.open(consentUri, "_blank")!; wnd.opener = null; @@ -2059,7 +2054,7 @@ export default class MatrixChat extends React.PureComponent { const cli = MatrixClientPeg.get(); if (!cli) return; - cli.sendEvent(roomId, event.getType() as keyof TimelineEvents, event.getContent()).then(() => { + void cli.sendEvent(roomId, event.getType() as keyof TimelineEvents, event.getContent()).then(() => { dis.dispatch({ action: "message_sent" }); }); } diff --git a/apps/web/src/components/structures/NonUrgentToastContainer.tsx b/apps/web/src/components/structures/NonUrgentToastContainer.tsx index 481c9f0bf98..18af1878d24 100644 --- a/apps/web/src/components/structures/NonUrgentToastContainer.tsx +++ b/apps/web/src/components/structures/NonUrgentToastContainer.tsx @@ -41,7 +41,7 @@ export default class NonUrgentToastContainer extends React.PureComponent { return ( -
+
{React.createElement(t, {})}
); diff --git a/apps/web/src/components/structures/RightPanel.tsx b/apps/web/src/components/structures/RightPanel.tsx index 00cdebe5b52..b2219856278 100644 --- a/apps/web/src/components/structures/RightPanel.tsx +++ b/apps/web/src/components/structures/RightPanel.tsx @@ -139,7 +139,7 @@ export default class RightPanel extends React.Component { this.state.cardState?.verificationRequest?.pending ) { // When the user clicks close on the encryption panel cancel the pending request first if any - this.state.cardState.verificationRequest.cancel(); + void this.state.cardState.verificationRequest.cancel(); } else { RightPanelStore.instance.togglePanel(this.props.room?.roomId ?? null); } diff --git a/apps/web/src/components/structures/RoomSearchView.tsx b/apps/web/src/components/structures/RoomSearchView.tsx index bfd800e7d90..85cf6ca4699 100644 --- a/apps/web/src/components/structures/RoomSearchView.tsx +++ b/apps/web/src/components/structures/RoomSearchView.tsx @@ -131,7 +131,7 @@ export const RoomSearchView = ({ term, scope, promise, className, onUpdate, inPr // Mount & unmount effect useEffect(() => { aborted.current = false; - handleSearchResult(promise); + void handleSearchResult(promise); return () => { aborted.current = true; }; diff --git a/apps/web/src/components/structures/RoomView.tsx b/apps/web/src/components/structures/RoomView.tsx index c77ef7604f3..376b9844043 100644 --- a/apps/web/src/components/structures/RoomView.tsx +++ b/apps/web/src/components/structures/RoomView.tsx @@ -586,7 +586,7 @@ export class RoomView extends React.Component { createdByCurrentUserTs - lastCreatedByOtherTs < PREVENT_MULTIPLE_JITSI_WITHIN ) { // more than one Jitsi widget with the last one from the current user → remove it - WidgetUtils.setRoomWidget(this.context.client, this.state.roomId, createdByCurrentUser.id); + void WidgetUtils.setRoomWidget(this.context.client, this.state.roomId, createdByCurrentUser.id); } } @@ -1017,7 +1017,7 @@ export class RoomView extends React.Component { ), ]; - this.onRoomViewStoreUpdate(true); + void this.onRoomViewStoreUpdate(true); const call = this.getCallForRoom(); const callState = call?.state; @@ -1146,7 +1146,7 @@ export class RoomView extends React.Component { const action = getKeyBindingsManager().getRoomAction(ev); switch (action) { case KeyBindingAction.DismissReadMarker: - this.messagePanel?.forgetReadMarker(); + void this.messagePanel?.forgetReadMarker(); this.jumpToLiveTimeline(); handled = true; break; @@ -1199,7 +1199,7 @@ export class RoomView extends React.Component { case "picture_snapshot": { const roomId = this.getRoomId(); if (isNotUndefined(roomId)) { - ContentMessages.sharedInstance().sendContentListToRoom( + void ContentMessages.sharedInstance().sendContentListToRoom( [payload.file], roomId, undefined, @@ -1228,7 +1228,7 @@ export class RoomView extends React.Component { payload.event?.getRoomId() === this.state.roomId && payload.context === TimelineRenderingType.Search ) { - this.onCancelSearchClick(); + void this.onCancelSearchClick(); // we don't need to re-dispatch as RoomViewStore knows to persist with context=Search also } break; @@ -1241,7 +1241,7 @@ export class RoomView extends React.Component { }, () => { // send another "initial" RVS update to trigger peeking if needed - if (isReadyNow) this.onRoomViewStoreUpdate(true); + if (isReadyNow) void this.onRoomViewStoreUpdate(true); }, ); } @@ -1360,7 +1360,7 @@ export class RoomView extends React.Component { private onLocalRoomEvent(roomId: string): void { if (!this.context.client || !this.state.room || roomId !== this.state.room.roomId) return; - createRoomFromLocalRoom(this.context.client, this.state.room as LocalRoom); + void createRoomFromLocalRoom(this.context.client, this.state.room as LocalRoom); } private onRoomTimeline = ( @@ -1383,7 +1383,7 @@ export class RoomView extends React.Component { } if (ev.getType() === "m.room.encryption") { - this.updateE2EStatus(room); + void this.updateE2EStatus(room); this.updatePreviewUrlVisibility(); } @@ -1465,11 +1465,11 @@ export class RoomView extends React.Component { this.context.widgetLayoutStore.on(WidgetLayoutStore.emissionForRoom(room), this.onWidgetLayoutChange); this.calculatePeekRules(room); - this.loadMembersIfJoined(room); - this.calculateRecommendedVersion(room); + void this.loadMembersIfJoined(room); + void this.calculateRecommendedVersion(room); this.updatePermissions(room); this.checkWidgets(room); - this.updateRoomEncrypted(room); + void this.updateRoomEncrypted(room); if ( this.getMainSplitContentType(room) !== MainSplitContentType.Timeline && @@ -1577,13 +1577,13 @@ export class RoomView extends React.Component { if (!room || !room.currentState.getMember(userId)) { return; } - this.updateE2EStatus(room); + void this.updateE2EStatus(room); }; private onCrossSigningKeysChanged = (): void => { const room = this.state.room; if (room) { - this.updateE2EStatus(room); + void this.updateE2EStatus(room); } }; @@ -1650,7 +1650,7 @@ export class RoomView extends React.Component { private onMyMembership = (room: Room): void => { if (room.roomId === this.state.roomId) { this.forceUpdate(); - this.loadMembersIfJoined(room); + void this.loadMembersIfJoined(room); this.updatePermissions(room); } }; @@ -1677,7 +1677,7 @@ export class RoomView extends React.Component { () => { if (!this.state.room) return; this.updateDMState(); - this.updateE2EStatus(this.state.room); + void this.updateE2EStatus(this.state.room); }, 500, { leading: true, trailing: true }, @@ -1699,7 +1699,7 @@ export class RoomView extends React.Component { } const dmInviter = room?.getDMInviter(); if (dmInviter) { - Rooms.setDMRoom(room.client, room.roomId, dmInviter); + void Rooms.setDMRoom(room.client, room.roomId, dmInviter); } } @@ -1718,7 +1718,7 @@ export class RoomView extends React.Component { }); defaultDispatcher.dispatch({ action: "require_registration" }); } else { - Promise.resolve().then(() => { + void Promise.resolve().then(() => { const signUrl = this.props.threepidInvite?.signUrl; const roomId = this.getRoomId(); if (isNotUndefined(roomId)) { @@ -1986,7 +1986,7 @@ export class RoomView extends React.Component { // update the read marker to match the read-receipt private forgetReadMarker = (ev: ButtonEvent): void => { ev.stopPropagation(); - this.messagePanel?.forgetReadMarker(); + void this.messagePanel?.forgetReadMarker(); }; // decide whether or not the top 'unread messages' bar should be shown @@ -2202,8 +2202,8 @@ export class RoomView extends React.Component { private onFocus = (): void => { if (this.props.enableReadReceiptsAndMarkersOnActivity) return; - this.messagePanel?.sendReadReceipts(); - this.messagePanel?.updateReadMarker(); + void this.messagePanel?.sendReadReceipts(); + void this.messagePanel?.updateReadMarker(); }; public render(): ReactNode { diff --git a/apps/web/src/components/structures/ScrollPanel.tsx b/apps/web/src/components/structures/ScrollPanel.tsx index da77abe5e67..923c2e708d8 100644 --- a/apps/web/src/components/structures/ScrollPanel.tsx +++ b/apps/web/src/components/structures/ScrollPanel.tsx @@ -230,7 +230,7 @@ export default class ScrollPanel extends React.Component { this.updatePreventShrinking(); this.props.onScroll?.(ev); // noinspection JSIgnoredPromiseFromCall - this.checkFillState(); + void this.checkFillState(); }; private onResize = (): void => { @@ -250,9 +250,9 @@ export default class ScrollPanel extends React.Component { } // We don't care if these two conditions race - they're different trees. // noinspection JSIgnoredPromiseFromCall - this.restoreSavedScrollState(); + void this.restoreSavedScrollState(); // noinspection JSIgnoredPromiseFromCall - this.checkFillState(0, isFromPropsUpdate); + void this.checkFillState(0, isFromPropsUpdate); }; // return true if the content is fully scrolled down right now; else false. @@ -409,7 +409,7 @@ export default class ScrollPanel extends React.Component { this.fillRequestWhileRunning = false; this.pendingFillDueToPropsUpdate = false; // noinspection ES6MissingAwait - this.checkFillState(0, refillDueToPropsUpdate); + void this.checkFillState(0, refillDueToPropsUpdate); } }; diff --git a/apps/web/src/components/structures/SpaceRoomView.tsx b/apps/web/src/components/structures/SpaceRoomView.tsx index 701a10b3460..151abf38a05 100644 --- a/apps/web/src/components/structures/SpaceRoomView.tsx +++ b/apps/web/src/components/structures/SpaceRoomView.tsx @@ -531,7 +531,7 @@ const SpaceSetupPrivateInvite: React.FC<{ if (valid === false) { // true/null are allowed fieldRef.current!.focus(); - fieldRef.current!.validate({ allowEmpty: true, focused: true }); + void fieldRef.current!.validate({ allowEmpty: true, focused: true }); return; } } diff --git a/apps/web/src/components/structures/ThreadPanel.tsx b/apps/web/src/components/structures/ThreadPanel.tsx index 7c8a5d0c3d5..d5deb5cdc77 100644 --- a/apps/web/src/components/structures/ThreadPanel.tsx +++ b/apps/web/src/components/structures/ThreadPanel.tsx @@ -170,7 +170,8 @@ const ThreadPanel: React.FC = ({ roomId, onClose, permalinkCreator }) => useEffect(() => { const room = mxClient.getRoom(roomId); - room?.createThreadsTimelineSets() + void room + ?.createThreadsTimelineSets() .then(() => room.fetchRoomThreads()) .then(() => { setFilterOption(ThreadFilterType.All); diff --git a/apps/web/src/components/structures/ThreadView.tsx b/apps/web/src/components/structures/ThreadView.tsx index 3ff168a46c4..12dfc41d324 100644 --- a/apps/web/src/components/structures/ThreadView.tsx +++ b/apps/web/src/components/structures/ThreadView.tsx @@ -110,7 +110,7 @@ export default class ThreadView extends React.Component { ); if (this.state.thread) { - this.postThreadUpdate(this.state.thread); + void this.postThreadUpdate(this.state.thread); } this.setupThread(this.props.mxEvent); diff --git a/apps/web/src/components/structures/TimelinePanel.tsx b/apps/web/src/components/structures/TimelinePanel.tsx index 392622745ba..8fa5fc4e593 100644 --- a/apps/web/src/components/structures/TimelinePanel.tsx +++ b/apps/web/src/components/structures/TimelinePanel.tsx @@ -312,10 +312,10 @@ class TimelinePanel extends React.Component { this.props.timelineSet.room?.on(ThreadEvent.Update, this.onThreadUpdate); if (this.props.manageReadReceipts && this.props.enableReadReceiptsAndMarkersOnActivity) { - this.updateReadReceiptOnUserActivity(); + void this.updateReadReceiptOnUserActivity(); } if (this.props.manageReadMarkers && this.props.enableReadReceiptsAndMarkersOnActivity) { - this.updateReadMarkerOnUserActivity(); + void this.updateReadMarkerOnUserActivity(); } this.initTimeline(this.props); } @@ -702,7 +702,7 @@ class TimelinePanel extends React.Component { // timeline window. // // see https://github.com/vector-im/vector-web/issues/1035 - this.timelineWindow!.paginate(EventTimeline.FORWARDS, 1, false).then(() => { + void this.timelineWindow!.paginate(EventTimeline.FORWARDS, 1, false).then(() => { if (this.unmounted) { return; } @@ -734,7 +734,7 @@ class TimelinePanel extends React.Component { // we know we're stuckAtBottom, so we can advance the RM // immediately, to save a later render cycle - this.setReadMarker(lastLiveEvent.getId() ?? null, lastLiveEvent.getTs(), true); + void this.setReadMarker(lastLiveEvent.getId() ?? null, lastLiveEvent.getTs(), true); updatedState.readMarkerVisible = false; updatedState.readMarkerEventId = lastLiveEvent.getId(); callRMUpdated = true; @@ -1224,7 +1224,7 @@ class TimelinePanel extends React.Component { i--; const ev = events[i]; - this.setReadMarker(ev.getId()!, ev.getTs()); + void this.setReadMarker(ev.getId()!, ev.getTs()); } /* jump down to the bottom of this room, where new events are arriving @@ -1533,7 +1533,7 @@ class TimelinePanel extends React.Component { }); if (onFinished) { // oxlint-disable-next-line promise/no-promise-in-callback - finished.then(onFinished); + void finished.then(onFinished); } }; @@ -1551,7 +1551,7 @@ class TimelinePanel extends React.Component { if (this.props.timelineSet.getTimelineForEvent(eventId)) { // if we've got an eventId, and the timeline exists, we can skip // the promise tick. - this.timelineWindow.load(eventId, INITIAL_SIZE); + void this.timelineWindow.load(eventId, INITIAL_SIZE); // in this branch this method will happen in sync time onLoaded(); return; @@ -1595,7 +1595,7 @@ class TimelinePanel extends React.Component { // We want the last event to be decrypted first const client = MatrixClientPeg.safeGet(); for (let i = events.length - 1; i >= 0; --i) { - client.decryptEventIfNeeded(events[i]); + void client.decryptEventIfNeeded(events[i]); } // Hold onto the live events separately. The read receipt and read marker diff --git a/apps/web/src/components/structures/UserView.tsx b/apps/web/src/components/structures/UserView.tsx index ded92b6eb9e..c5a79bee151 100644 --- a/apps/web/src/components/structures/UserView.tsx +++ b/apps/web/src/components/structures/UserView.tsx @@ -43,7 +43,7 @@ export default class UserView extends React.Component { public componentDidMount(): void { if (this.props.userId) { - this.loadProfileInfo(); + void this.loadProfileInfo(); } } @@ -52,7 +52,7 @@ export default class UserView extends React.Component { // it as optional and MatrixChat sometimes fires in a way which results // in an NPE when we try to update the profile info. if (prevProps.userId !== this.props.userId && this.props.userId) { - this.loadProfileInfo(); + void this.loadProfileInfo(); } } diff --git a/apps/web/src/components/structures/auth/ForgotPassword.tsx b/apps/web/src/components/structures/auth/ForgotPassword.tsx index e6de8edb8ba..d9caebbf8cc 100644 --- a/apps/web/src/components/structures/auth/ForgotPassword.tsx +++ b/apps/web/src/components/structures/auth/ForgotPassword.tsx @@ -106,7 +106,7 @@ export default class ForgotPassword extends React.Component { prevProps.serverConfig.isUrl !== this.props.serverConfig.isUrl ) { // Do a liveliness check on the new URLs - this.checkServerLiveliness(this.props.serverConfig); + void this.checkServerLiveliness(this.props.serverConfig); } } @@ -219,7 +219,7 @@ export default class ForgotPassword extends React.Component { // Focus on the first invalid field, then re-validate, // which will result in the error tooltip being displayed for that field. invalidFields[0].focus(); - invalidFields[0].validate({ allowEmpty: false, focused: true }); + void invalidFields[0].validate({ allowEmpty: false, focused: true }); return false; } @@ -309,13 +309,13 @@ export default class ForgotPassword extends React.Component { switch (this.state.phase) { case Phase.EnterEmail: - this.onPhaseEmailInputSubmit(); + await this.onPhaseEmailInputSubmit(); break; case Phase.EmailSent: - this.onPhaseEmailSentSubmit(); + await this.onPhaseEmailSentSubmit(); break; case Phase.PasswordInput: - this.onPhasePasswordInputSubmit(); + await this.onPhasePasswordInputSubmit(); break; } }; diff --git a/apps/web/src/components/structures/auth/Login.tsx b/apps/web/src/components/structures/auth/Login.tsx index e393e9c996e..e88b295cb95 100644 --- a/apps/web/src/components/structures/auth/Login.tsx +++ b/apps/web/src/components/structures/auth/Login.tsx @@ -128,7 +128,7 @@ class LoginComponent extends React.PureComponent { public componentDidMount(): void { this.unmounted = false; - this.initLoginLogic(this.props.serverConfig); + void this.initLoginLogic(this.props.serverConfig); } public componentWillUnmount(): void { @@ -144,7 +144,7 @@ class LoginComponent extends React.PureComponent { prevProps.serverConfig.delegatedAuthentication !== this.props.serverConfig.delegatedAuthentication ) { // Ensure that we end up actually logging in to the right place - this.initLoginLogic(this.props.serverConfig); + void this.initLoginLogic(this.props.serverConfig); } } diff --git a/apps/web/src/components/structures/auth/Registration.tsx b/apps/web/src/components/structures/auth/Registration.tsx index a7c4cfeed4b..c02f723b618 100644 --- a/apps/web/src/components/structures/auth/Registration.tsx +++ b/apps/web/src/components/structures/auth/Registration.tsx @@ -157,7 +157,7 @@ export default class Registration extends React.Component { } public componentDidMount(): void { - this.replaceClient(this.props.serverConfig); + void this.replaceClient(this.props.serverConfig); //triggers a confirmation dialog for data loss before page unloads/refreshes window.addEventListener("beforeunload", this.unloadCallback); } @@ -179,7 +179,7 @@ export default class Registration extends React.Component { prevProps.serverConfig.hsUrl !== this.props.serverConfig.hsUrl || prevProps.serverConfig.isUrl !== this.props.serverConfig.isUrl ) { - this.replaceClient(this.props.serverConfig); + void this.replaceClient(this.props.serverConfig); } } @@ -428,7 +428,7 @@ export default class Registration extends React.Component { accessToken, }); - this.setupPushers(); + void this.setupPushers(); } } else { newState.busy = false; @@ -476,7 +476,7 @@ export default class Registration extends React.Component { private onGoToFormClicked = (ev: ButtonEvent): void => { ev.preventDefault(); ev.stopPropagation(); - this.replaceClient(this.props.serverConfig); + void this.replaceClient(this.props.serverConfig); this.setState({ busy: false, doingUIAuth: false, diff --git a/apps/web/src/components/structures/auth/SetupEncryptionBody.tsx b/apps/web/src/components/structures/auth/SetupEncryptionBody.tsx index 22b7a1adb50..96b6fac1ba2 100644 --- a/apps/web/src/components/structures/auth/SetupEncryptionBody.tsx +++ b/apps/web/src/components/structures/auth/SetupEncryptionBody.tsx @@ -94,7 +94,7 @@ export default class SetupEncryptionBody extends React.Component private onUsePassphraseClick = async (): Promise => { const store = SetupEncryptionStore.sharedInstance(); - store.usePassPhrase(); + await store.usePassPhrase(); }; private onVerifyClick = (): void => { @@ -110,9 +110,9 @@ export default class SetupEncryptionBody extends React.Component member: cli.getUser(userId) ?? undefined, }); - verificationFinished.then(async () => { + void verificationFinished.then(async () => { const request = await requestPromise; - request.cancel(); + void request.cancel(); this.props.onFinished(); }); }; diff --git a/apps/web/src/components/structures/auth/SoftLogout.tsx b/apps/web/src/components/structures/auth/SoftLogout.tsx index 171dde37ad5..9374122cb66 100644 --- a/apps/web/src/components/structures/auth/SoftLogout.tsx +++ b/apps/web/src/components/structures/auth/SoftLogout.tsx @@ -79,16 +79,16 @@ export default class SoftLogout extends React.Component { return; } - this.initLogin(); + void this.initLogin(); } private onClearAll = (): void => { const { finished } = Modal.createDialog(ConfirmWipeDeviceDialog); - finished.then(([wipeData]) => { + void finished.then(([wipeData]) => { if (!wipeData) return; logger.log("Clearing data from soft-logged-out session"); - Lifecycle.logout(); + void Lifecycle.logout(); }); }; diff --git a/apps/web/src/components/structures/auth/forgot-password/EnterEmail.tsx b/apps/web/src/components/structures/auth/forgot-password/EnterEmail.tsx index 9d88f1c8cec..cd05616b39b 100644 --- a/apps/web/src/components/structures/auth/forgot-password/EnterEmail.tsx +++ b/apps/web/src/components/structures/auth/forgot-password/EnterEmail.tsx @@ -50,7 +50,7 @@ export const EnterEmail: React.FC = ({ } emailFieldRef.current?.focus(); - emailFieldRef.current?.validate({ allowEmpty: false, focused: true }); + await emailFieldRef.current?.validate({ allowEmpty: false, focused: true }); }; return ( diff --git a/apps/web/src/components/viewmodels/memberlist/MemberListViewModel.tsx b/apps/web/src/components/viewmodels/memberlist/MemberListViewModel.tsx index 41233a4d6f5..94451f3e90d 100644 --- a/apps/web/src/components/viewmodels/memberlist/MemberListViewModel.tsx +++ b/apps/web/src/components/viewmodels/memberlist/MemberListViewModel.tsx @@ -211,48 +211,48 @@ export function useMemberListViewModel(roomId: string): MemberListViewState { useTypedEventEmitter(cli, RoomStateEvent.Events, (event: MatrixEvent) => { if (event.getRoomId() === roomId && event.getType() === EventType.RoomThirdPartyInvite) { - loadMembers(); + void loadMembers(); const newCanInvite = getCanUserInviteToThisRoom(); setCanInvite(newCanInvite); } }); useTypedEventEmitter(cli, RoomStateEvent.Update, (state: RoomState) => { - if (state.roomId === roomId) loadMembers(); + if (state.roomId === roomId) void loadMembers(); }); useTypedEventEmitter(cli, RoomMemberEvent.Name, (_: MatrixEvent, member: SdkRoomMember) => { - if (member.roomId === roomId) loadMembers(); + if (member.roomId === roomId) void loadMembers(); }); useTypedEventEmitter(cli, ClientEvent.Room, (room: Room) => { // We listen for room events because when we accept an invite // we need to wait till the room is fully populated with state // before refreshing the member list else we get a stale list. - if (room.roomId === roomId) loadMembers(); + if (room.roomId === roomId) void loadMembers(); }); useTypedEventEmitter(cli, RoomEvent.MyMembership, (room: Room, membership: string, oldMembership?: string) => { if (room.roomId !== roomId) return; if (membership === KnownMembership.Join && oldMembership !== KnownMembership.Join) { // we just joined the room, load the member list - loadMembers(); + void loadMembers(); const newShouldShowInvite = getShouldShowInvite(); setShouldShowInvite(newShouldShowInvite); } }); useTypedEventEmitter(cli, UserEvent.Presence, (_: MatrixEvent | undefined, user: User) => { - if (memberMap.has(user.userId)) loadMembers(); + if (memberMap.has(user.userId)) void loadMembers(); }); useTypedEventEmitter(cli, UserEvent.CurrentlyActive, (_: MatrixEvent | undefined, user: User) => { - if (memberMap.has(user.userId)) loadMembers(); + if (memberMap.has(user.userId)) void loadMembers(); }); // Initial load of the memberlist useEffect(() => { - (async () => { + void (async () => { await loadMembers(); /** * isLoading is used to render a spinner on initial call. diff --git a/apps/web/src/components/viewmodels/memberlist/tiles/MemberTileViewModel.tsx b/apps/web/src/components/viewmodels/memberlist/tiles/MemberTileViewModel.tsx index 1cb29029ea6..fa534ef3bc8 100644 --- a/apps/web/src/components/viewmodels/memberlist/tiles/MemberTileViewModel.tsx +++ b/apps/web/src/components/viewmodels/memberlist/tiles/MemberTileViewModel.tsx @@ -77,12 +77,12 @@ export function useMemberTileViewModel(props: MemberTileViewModelProps): MemberT // The room is encrypted now. cli.removeListener(RoomStateEvent.Events, onRoomStateEvents); - updateE2EStatus(); + void updateE2EStatus(); }; const onUserTrustStatusChanged = (userId: string, trustStatus: UserVerificationStatus): void => { if (userId !== props.member.userId) return; - updateE2EStatus(); + void updateE2EStatus(); }; const { roomId } = props.member; @@ -90,7 +90,7 @@ export function useMemberTileViewModel(props: MemberTileViewModelProps): MemberT const isRoomEncrypted = cli.isRoomEncrypted(roomId); if (isRoomEncrypted) { cli.on(CryptoEvent.UserTrustStatusChanged, onUserTrustStatusChanged); - updateE2EStatus(); + void updateE2EStatus(); } else { // Listen for room to become encrypted cli.on(RoomStateEvent.Events, onRoomStateEvents); diff --git a/apps/web/src/components/viewmodels/right_panel/user_info/UserInfoIgnoreButtonViewModel.tsx b/apps/web/src/components/viewmodels/right_panel/user_info/UserInfoIgnoreButtonViewModel.tsx index 3c243feaece..f8214757073 100644 --- a/apps/web/src/components/viewmodels/right_panel/user_info/UserInfoIgnoreButtonViewModel.tsx +++ b/apps/web/src/components/viewmodels/right_panel/user_info/UserInfoIgnoreButtonViewModel.tsx @@ -32,7 +32,7 @@ export const useUserInfoIgnoreButtonViewModel = (member: User | RoomMember): Use const ignoredUsers = cli.getIgnoredUsers(); const index = ignoredUsers.indexOf(member.userId); if (index !== -1) ignoredUsers.splice(index, 1); - cli.setIgnoredUsers(ignoredUsers); + void cli.setIgnoredUsers(ignoredUsers); }, [cli, member]); const ignore = useCallback(async () => { @@ -47,7 +47,7 @@ export const useUserInfoIgnoreButtonViewModel = (member: User | RoomMember): Use if (confirmed) { const ignoredUsers = cli.getIgnoredUsers(); ignoredUsers.push(member.userId); - cli.setIgnoredUsers(ignoredUsers); + void cli.setIgnoredUsers(ignoredUsers); } }, [cli, member]); @@ -74,7 +74,7 @@ export const useUserInfoIgnoreButtonViewModel = (member: User | RoomMember): Use if (isIgnored) { unignore(); } else { - ignore(); + void ignore(); } }; diff --git a/apps/web/src/components/views/audio_messages/AudioPlayerBase.tsx b/apps/web/src/components/views/audio_messages/AudioPlayerBase.tsx index 9da1020634f..6b87d8b2cb5 100644 --- a/apps/web/src/components/views/audio_messages/AudioPlayerBase.tsx +++ b/apps/web/src/components/views/audio_messages/AudioPlayerBase.tsx @@ -61,7 +61,7 @@ export default abstract class AudioPlayerBase extends switch (action) { case KeyBindingAction.Space: - this.playPauseRef.current?.toggleState(); + void this.playPauseRef.current?.toggleState(); break; case KeyBindingAction.ArrowLeft: this.seekRef.current?.left(); diff --git a/apps/web/src/components/views/audio_messages/LegacySeekBar.tsx b/apps/web/src/components/views/audio_messages/LegacySeekBar.tsx index 92d5415fefb..ad7301ce151 100644 --- a/apps/web/src/components/views/audio_messages/LegacySeekBar.tsx +++ b/apps/web/src/components/views/audio_messages/LegacySeekBar.tsx @@ -73,12 +73,12 @@ export default class LegacySeekBar extends React.PureComponent { public left(): void { // noinspection JSIgnoredPromiseFromCall - this.props.playback.skipTo(this.props.playback.timeSeconds - ARROW_SKIP_SECONDS); + void this.props.playback.skipTo(this.props.playback.timeSeconds - ARROW_SKIP_SECONDS); } public right(): void { // noinspection JSIgnoredPromiseFromCall - this.props.playback.skipTo(this.props.playback.timeSeconds + ARROW_SKIP_SECONDS); + void this.props.playback.skipTo(this.props.playback.timeSeconds + ARROW_SKIP_SECONDS); } private onChange = (ev: ChangeEvent): void => { @@ -86,7 +86,7 @@ export default class LegacySeekBar extends React.PureComponent { // change the value on the component. We can use this as a reliable "skip to X" function. // // noinspection JSIgnoredPromiseFromCall - this.props.playback.skipTo(Number(ev.target.value) * this.props.playback.durationSeconds); + void this.props.playback.skipTo(Number(ev.target.value) * this.props.playback.durationSeconds); }; private onMouseDown = (event: React.MouseEvent): void => { diff --git a/apps/web/src/components/views/audio_messages/Waveform.tsx b/apps/web/src/components/views/audio_messages/Waveform.tsx index 115b310f4ca..03ae0d56177 100644 --- a/apps/web/src/components/views/audio_messages/Waveform.tsx +++ b/apps/web/src/components/views/audio_messages/Waveform.tsx @@ -43,6 +43,7 @@ export default class Waveform extends React.PureComponent { }); return ( { ); break; case Phase.ShowingQR: { - let steps: ReactNode[]; + let steps: ReactNode; if (this.props.intent === RendezvousIntent.LOGIN_ON_NEW_DEVICE) { - steps = [ - _t("auth|qr_code_login|open_element_mobile_device", { - brand: SdkConfig.get().brand, - }), - _t("auth|qr_code_login|tap_avatar_link_new_device", { - linkNewDevice: {_t("settings|sessions|sign_in_with_qr")}, - }), - _t("auth|qr_code_login|choose_desktop_computer", { - desktopComputer: {_t("auth|qr_code_login|desktop_computer")}, - }), - _t("auth|qr_code_login|select_ready_to_scan", { - readyToScan: {_t("auth|qr_code_login|ready_to_scan")}, - }), - _t("auth|qr_code_login|follow_remaining_instructions"), - ]; + steps = ( + <> +
  • + {_t("auth|qr_code_login|open_element_mobile_device", { + brand: SdkConfig.get().brand, + })}{" "} +
  • + , +
  • + {_t("auth|qr_code_login|tap_avatar_link_new_device", { + linkNewDevice: {_t("settings|sessions|sign_in_with_qr")}, + })}{" "} +
  • + , +
  • + {_t("auth|qr_code_login|choose_desktop_computer", { + desktopComputer: {_t("auth|qr_code_login|desktop_computer")}, + })}{" "} +
  • + , +
  • + {_t("auth|qr_code_login|select_ready_to_scan", { + readyToScan: {_t("auth|qr_code_login|ready_to_scan")}, + })}{" "} +
  • + ,
  • {_t("auth|qr_code_login|follow_remaining_instructions")}
  • , + + ); } else { - steps = [ - _t("auth|qr_code_login|open_element_other_device", { - brand: SdkConfig.get().brand, - }), - _t("auth|qr_code_login|select_qr_code", { - scanQRCode: {_t("auth|qr_code_login|scan_qr_code")}, - }), - _t("auth|qr_code_login|point_the_camera"), - _t("auth|qr_code_login|follow_remaining_instructions"), - ]; + steps = ( + <> +
  • + {_t("auth|qr_code_login|open_element_other_device", { + brand: SdkConfig.get().brand, + })}{" "} +
  • + , +
  • + {_t("auth|qr_code_login|select_qr_code", { + scanQRCode: {_t("auth|qr_code_login|scan_qr_code")}, + })}{" "} +
  • + ,
  • {_t("auth|qr_code_login|point_the_camera")}
  • , +
  • {_t("auth|qr_code_login|follow_remaining_instructions")}
  • , + + ); } main = ( @@ -308,11 +328,7 @@ export default class LoginWithQRFlow extends React.Component { )}
    -
      - {steps.map((step, i) => ( -
    1. {step}
    2. - ))} -
    +
      {steps}
    ); break; diff --git a/apps/web/src/components/views/auth/PasswordLogin.tsx b/apps/web/src/components/views/auth/PasswordLogin.tsx index 97978cb4e22..1f23e3a3ee1 100644 --- a/apps/web/src/components/views/auth/PasswordLogin.tsx +++ b/apps/web/src/components/views/auth/PasswordLogin.tsx @@ -174,7 +174,7 @@ export default class PasswordLogin extends React.PureComponent { // Focus the first invalid field and show feedback in the stricter mode // that no longer allows empty values for required fields. invalidField.focus(); - invalidField.validate({ allowEmpty: false, focused: true }); + void invalidField.validate({ allowEmpty: false, focused: true }); return false; } diff --git a/apps/web/src/components/views/auth/RegistrationForm.tsx b/apps/web/src/components/views/auth/RegistrationForm.tsx index 0577de31f51..91524c83847 100644 --- a/apps/web/src/components/views/auth/RegistrationForm.tsx +++ b/apps/web/src/components/views/auth/RegistrationForm.tsx @@ -124,7 +124,7 @@ export default class RegistrationForm extends React.PureComponent { + void finished.then(async ([confirmed, email]) => { if (confirmed && email !== undefined) { this.setState({ email }, () => this.doSubmit(ev)); } @@ -156,7 +156,7 @@ export default class RegistrationForm extends React.PureComponent = ({ de const getDevices = async (): Promise => { return setDevices((await MediaDeviceHandler.getDevices())?.[deviceKind] ?? []); }; - getDevices(); + void getDevices(); }, [deviceKind]); const onDeviceClick = (deviceId: string): void => { - MediaDeviceHandler.instance.setDevice(deviceId, deviceKind); + void MediaDeviceHandler.instance.setDevice(deviceId, deviceKind); setSelectedDevice(deviceId); }; diff --git a/apps/web/src/components/views/context_menus/MessageContextMenu.tsx b/apps/web/src/components/views/context_menus/MessageContextMenu.tsx index 086301ee57c..d3207820187 100644 --- a/apps/web/src/components/views/context_menus/MessageContextMenu.tsx +++ b/apps/web/src/components/views/context_menus/MessageContextMenu.tsx @@ -225,7 +225,7 @@ export default class MessageContextMenu extends React.Component private onResendReactionsClick = (): void => { for (const reaction of this.getUnsentReactions()) { - Resend.resend(MatrixClientPeg.safeGet(), reaction); + void Resend.resend(MatrixClientPeg.safeGet(), reaction); } this.closeMenu(); }; @@ -278,7 +278,7 @@ export default class MessageContextMenu extends React.Component private onPinClick = (isPinned: boolean): void => { // Pin or unpin in background - PinningUtils.pinOrUnpinEvent(MatrixClientPeg.safeGet(), this.props.mxEvent); + void PinningUtils.pinOrUnpinEvent(MatrixClientPeg.safeGet(), this.props.mxEvent); PosthogTrackers.trackPinUnpinMessage(isPinned ? "Pin" : "Unpin", "Timeline"); this.closeMenu(); @@ -305,7 +305,7 @@ export default class MessageContextMenu extends React.Component private onCopyLinkClick = (e: ButtonEvent): void => { e.preventDefault(); // So that we don't open the permalink if (!this.props.link) return; - copyPlaintext(this.props.link); + void copyPlaintext(this.props.link); this.closeMenu(); }; @@ -315,7 +315,7 @@ export default class MessageContextMenu extends React.Component }; private onCopyClick = (): void => { - copyPlaintext(getSelectedText()); + void copyPlaintext(getSelectedText()); this.closeMenu(); }; diff --git a/apps/web/src/components/views/context_menus/RoomGeneralContextMenu.tsx b/apps/web/src/components/views/context_menus/RoomGeneralContextMenu.tsx index 5da2978f830..f7cec13c31b 100644 --- a/apps/web/src/components/views/context_menus/RoomGeneralContextMenu.tsx +++ b/apps/web/src/components/views/context_menus/RoomGeneralContextMenu.tsx @@ -267,7 +267,7 @@ export const RoomGeneralContextMenu: React.FC = ({ return ( { - clearRoomNotification(room, cli); + void clearRoomNotification(room, cli); onFinished?.(); }, onPostMarkAsReadClick)} label={_t("room|context_menu|mark_read")} @@ -278,7 +278,7 @@ export const RoomGeneralContextMenu: React.FC = ({ return ( { - setMarkedUnreadState(room, cli, true); + void setMarkedUnreadState(room, cli, true); onFinished?.(); }, onPostMarkAsUnreadClick)} label={_t("room|context_menu|mark_unread")} diff --git a/apps/web/src/components/views/context_menus/SpaceContextMenu.tsx b/apps/web/src/components/views/context_menus/SpaceContextMenu.tsx index 49d8275ab66..c96ab24842d 100644 --- a/apps/web/src/components/views/context_menus/SpaceContextMenu.tsx +++ b/apps/web/src/components/views/context_menus/SpaceContextMenu.tsx @@ -151,7 +151,7 @@ const SpaceContextMenu: React.FC = ({ space, hideHeader, onFinished, ... ev.stopPropagation(); PosthogTrackers.trackInteraction("WebSpaceContextMenuNewRoomItem", ev); - showCreateNewRoom(space); + void showCreateNewRoom(space); onFinished(); }; @@ -159,7 +159,7 @@ const SpaceContextMenu: React.FC = ({ space, hideHeader, onFinished, ... ev.preventDefault(); ev.stopPropagation(); - showCreateNewRoom(space, elementCallVideoRoomsEnabled ? RoomType.UnstableCall : RoomType.ElementVideo); + void showCreateNewRoom(space, elementCallVideoRoomsEnabled ? RoomType.UnstableCall : RoomType.ElementVideo); onFinished(); }; diff --git a/apps/web/src/components/views/dialogs/AskInviteAnywayDialog.tsx b/apps/web/src/components/views/dialogs/AskInviteAnywayDialog.tsx index ddc4c04d4ab..b6245421369 100644 --- a/apps/web/src/components/views/dialogs/AskInviteAnywayDialog.tsx +++ b/apps/web/src/components/views/dialogs/AskInviteAnywayDialog.tsx @@ -46,7 +46,7 @@ export default function AskInviteAnywayDialog({ }, [onInviteAnyways, onFinished]); const onInviteNeverWarnClicked = useCallback((): void => { - SettingsStore.setValue("promptBeforeInviteUnknownUsers", null, SettingLevel.ACCOUNT, false); + void SettingsStore.setValue("promptBeforeInviteUnknownUsers", null, SettingLevel.ACCOUNT, false); onInviteAnyways(); onFinished(true); }, [onInviteAnyways, onFinished]); diff --git a/apps/web/src/components/views/dialogs/BugReportDialog.tsx b/apps/web/src/components/views/dialogs/BugReportDialog.tsx index f4bfc2f2c04..3b451133566 100644 --- a/apps/web/src/components/views/dialogs/BugReportDialog.tsx +++ b/apps/web/src/components/views/dialogs/BugReportDialog.tsx @@ -182,7 +182,7 @@ export default class BugReportDialog extends React.Component => { diff --git a/apps/web/src/components/views/dialogs/ChangelogDialog.tsx b/apps/web/src/components/views/dialogs/ChangelogDialog.tsx index b2eb151943c..6af78a31506 100644 --- a/apps/web/src/components/views/dialogs/ChangelogDialog.tsx +++ b/apps/web/src/components/views/dialogs/ChangelogDialog.tsx @@ -84,7 +84,7 @@ export default class ChangelogDialog extends React.Component { const newCommits = parseVersion(this.props.newVersion)!; for (const repo of REPOS) { - this.fetchChanges(repo, commits[repo], newCommits[repo]); + void this.fetchChanges(repo, commits[repo], newCommits[repo]); } } diff --git a/apps/web/src/components/views/dialogs/ConfirmRedactDialog.tsx b/apps/web/src/components/views/dialogs/ConfirmRedactDialog.tsx index 17bf75ccadb..796adb47ec3 100644 --- a/apps/web/src/components/views/dialogs/ConfirmRedactDialog.tsx +++ b/apps/web/src/components/views/dialogs/ConfirmRedactDialog.tsx @@ -60,7 +60,7 @@ export function createRedactEventDialog({ if (!roomId) throw new Error(`cannot redact event ${mxEvent.getId()} without room ID`); const { finished } = Modal.createDialog(ConfirmRedactDialog, { event: mxEvent }, "mx_Dialog_confirmredact"); - finished.then(async ([proceed, reason]) => { + void finished.then(async ([proceed, reason]) => { if (!proceed) return; const cli = MatrixClientPeg.safeGet(); diff --git a/apps/web/src/components/views/dialogs/CreateRoomDialog.tsx b/apps/web/src/components/views/dialogs/CreateRoomDialog.tsx index 5321390fca1..e76519f0a57 100644 --- a/apps/web/src/components/views/dialogs/CreateRoomDialog.tsx +++ b/apps/web/src/components/views/dialogs/CreateRoomDialog.tsx @@ -176,7 +176,7 @@ export default class CreateRoomDialog extends React.Component { public componentDidMount(): void { const cli = MatrixClientPeg.safeGet(); - checkUserIsAllowedToChangeEncryption(cli, Preset.PrivateChat).then(({ allowChange, forcedValue }) => + void checkUserIsAllowedToChangeEncryption(cli, Preset.PrivateChat).then(({ allowChange, forcedValue }) => this.setState((state) => ({ canChangeEncryption: allowChange, // override with forcedValue if it is set @@ -192,7 +192,7 @@ export default class CreateRoomDialog extends React.Component { const action = getKeyBindingsManager().getAccessibilityAction(event); switch (action) { case KeyBindingAction.Enter: - this.onOk(); + void this.onOk(); event.preventDefault(); event.stopPropagation(); break; diff --git a/apps/web/src/components/views/dialogs/CreateSubspaceDialog.tsx b/apps/web/src/components/views/dialogs/CreateSubspaceDialog.tsx index 7223db55f92..f03d8955ed1 100644 --- a/apps/web/src/components/views/dialogs/CreateSubspaceDialog.tsx +++ b/apps/web/src/components/views/dialogs/CreateSubspaceDialog.tsx @@ -53,7 +53,7 @@ const CreateSubspaceDialog: React.FC = ({ space, onAddExistingSpaceClick // require & validate the space name field if (spaceNameField.current && !(await spaceNameField.current.validate({ allowEmpty: false }))) { spaceNameField.current.focus(); - spaceNameField.current.validate({ allowEmpty: false, focused: true }); + void spaceNameField.current.validate({ allowEmpty: false, focused: true }); setBusy(false); return; } @@ -64,7 +64,7 @@ const CreateSubspaceDialog: React.FC = ({ space, onAddExistingSpaceClick !(await spaceAliasField.current.validate({ allowEmpty: true })) ) { spaceAliasField.current.focus(); - spaceAliasField.current.validate({ allowEmpty: true, focused: true }); + void spaceAliasField.current.validate({ allowEmpty: true, focused: true }); setBusy(false); return; } diff --git a/apps/web/src/components/views/dialogs/ExportDialog.tsx b/apps/web/src/components/views/dialogs/ExportDialog.tsx index d4c19374fea..f2b1839b5f9 100644 --- a/apps/web/src/components/views/dialogs/ExportDialog.tsx +++ b/apps/web/src/components/views/dialogs/ExportDialog.tsx @@ -141,13 +141,13 @@ const ExportDialog: React.FC = ({ room, onFinished }) => { })); if (!isValidSize) { - sizeLimitRef.current?.validate({ focused: true }); + void sizeLimitRef.current?.validate({ focused: true }); return; } if (exportType === ExportType.LastNMessages) { const isValidNumberOfMessages = await messageCountRef.current?.validate({ focused: false }); if (!isValidNumberOfMessages) { - messageCountRef.current?.validate({ focused: true }); + void messageCountRef.current?.validate({ focused: true }); return; } } diff --git a/apps/web/src/components/views/dialogs/FeedbackDialog.tsx b/apps/web/src/components/views/dialogs/FeedbackDialog.tsx index 40814d615a5..c70f16de537 100644 --- a/apps/web/src/components/views/dialogs/FeedbackDialog.tsx +++ b/apps/web/src/components/views/dialogs/FeedbackDialog.tsx @@ -46,7 +46,7 @@ const FeedbackDialog: React.FC = (props: IProps) => { if (hasFeedback && sendFeedback) { const label = props.feature ? `${props.feature}-feedback` : "feedback"; // TODO: Handle rejection. - submitFeedback(label, comment, canContact); + void submitFeedback(label, comment, canContact); Modal.createDialog(InfoDialog, { title: _t("feedback|sent"), diff --git a/apps/web/src/components/views/dialogs/ForwardDialog.tsx b/apps/web/src/components/views/dialogs/ForwardDialog.tsx index ae5b43ad50b..82d7169ad39 100644 --- a/apps/web/src/components/views/dialogs/ForwardDialog.tsx +++ b/apps/web/src/components/views/dialogs/ForwardDialog.tsx @@ -249,7 +249,7 @@ const ForwardDialog: React.FC = ({ matrixClient: cli, event, permalinkCr const userId = cli.getSafeUserId(); const [profileInfo, setProfileInfo] = useState({}); useEffect(() => { - cli.getProfileInfo(userId).then((info) => setProfileInfo(info)); + void cli.getProfileInfo(userId).then((info) => setProfileInfo(info)); }, [cli, userId]); const { type, content } = transformEvent(event, cli); diff --git a/apps/web/src/components/views/dialogs/GenericFeatureFeedbackDialog.tsx b/apps/web/src/components/views/dialogs/GenericFeatureFeedbackDialog.tsx index c2f79a6c8a9..51995a660cf 100644 --- a/apps/web/src/components/views/dialogs/GenericFeatureFeedbackDialog.tsx +++ b/apps/web/src/components/views/dialogs/GenericFeatureFeedbackDialog.tsx @@ -39,7 +39,7 @@ const GenericFeatureFeedbackDialog: React.FC = ({ const sendFeedback = async (ok: boolean): Promise => { if (!ok) return onFinished(false); // TODO: Handle rejection. - submitFeedback(rageshakeLabel, comment, canContact, rageshakeData); + void submitFeedback(rageshakeLabel, comment, canContact, rageshakeData); onFinished(true); Modal.createDialog(InfoDialog, { diff --git a/apps/web/src/components/views/dialogs/IncomingSasDialog.tsx b/apps/web/src/components/views/dialogs/IncomingSasDialog.tsx index f9de0782495..971198f6a3a 100644 --- a/apps/web/src/components/views/dialogs/IncomingSasDialog.tsx +++ b/apps/web/src/components/views/dialogs/IncomingSasDialog.tsx @@ -68,7 +68,7 @@ export default class IncomingSasDialog extends React.Component { public componentDidMount(): void { this.props.verifier.on(VerifierEvent.ShowSas, this.onVerifierShowSas); this.props.verifier.on(VerifierEvent.Cancel, this.onVerifierCancel); - this.fetchOpponentProfile(); + void this.fetchOpponentProfile(); } public componentWillUnmount(): void { @@ -126,7 +126,7 @@ export default class IncomingSasDialog extends React.Component { }; private onSasMatchesClick = (): void => { - this.showSasEvent?.confirm(); + void this.showSasEvent?.confirm(); this.setState({ phase: PHASE_WAIT_FOR_PARTNER_TO_CONFIRM, }); diff --git a/apps/web/src/components/views/dialogs/InviteDialog.tsx b/apps/web/src/components/views/dialogs/InviteDialog.tsx index 77ed5b33ce0..3284b24daf8 100644 --- a/apps/web/src/components/views/dialogs/InviteDialog.tsx +++ b/apps/web/src/components/views/dialogs/InviteDialog.tsx @@ -250,7 +250,7 @@ export default class InviteDialog extends React.PureComponent { - this.updateSuggestions(term); + void this.updateSuggestions(term); }, 150); // 150ms debounce (human reaction time + some) }; @@ -1004,7 +1004,7 @@ export default class InviteDialog extends React.PureComponent { ev.preventDefault(); - this.transferCall(); + void this.transferCall(); }; private onDialChange = (ev: React.ChangeEvent): void => { diff --git a/apps/web/src/components/views/dialogs/MessageEditHistoryDialog.tsx b/apps/web/src/components/views/dialogs/MessageEditHistoryDialog.tsx index d54bc548aae..1729db30e5d 100644 --- a/apps/web/src/components/views/dialogs/MessageEditHistoryDialog.tsx +++ b/apps/web/src/components/views/dialogs/MessageEditHistoryDialog.tsx @@ -118,7 +118,7 @@ export default class MessageEditHistoryDialog extends React.PureComponent { @@ -103,7 +103,7 @@ export default class ModalWidgetDialog extends React.PureComponent { - this.state.messaging?.updateTheme({ name: theme }); + void this.state.messaging?.updateTheme({ name: theme }); }; private onWidgetClose = (ev: CustomEvent): void => { @@ -177,7 +177,7 @@ export default class ModalWidgetDialog extends React.PureComponent { - this.state.messaging?.notifyModalWidgetButtonClicked(def.id); + void this.state.messaging?.notifyModalWidgetButtonClicked(def.id); }; const isDisabled = this.state.disabledButtonIds.includes(def.id); diff --git a/apps/web/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx b/apps/web/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx index 5a00d87bfe8..9ba417bb801 100644 --- a/apps/web/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx +++ b/apps/web/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx @@ -31,7 +31,7 @@ const RegistrationEmailPromptDialog: React.FC = ({ onFinished }) => { if (!valid) { fieldRef.current.focus(); - fieldRef.current.validate({ focused: true }); + void fieldRef.current.validate({ focused: true }); return; } } diff --git a/apps/web/src/components/views/dialogs/ServerOfflineDialog.tsx b/apps/web/src/components/views/dialogs/ServerOfflineDialog.tsx index f403ecb7908..44029adb57f 100644 --- a/apps/web/src/components/views/dialogs/ServerOfflineDialog.tsx +++ b/apps/web/src/components/views/dialogs/ServerOfflineDialog.tsx @@ -51,7 +51,7 @@ export default class ServerOfflineDialog extends React.PureComponent { ); const entries = c.transactions .filter((t) => t.status === TransactionStatus.Error || t.didPreviouslyFail) - .map((t, j) => { + .map((t) => { let button = ; if (t.status === TransactionStatus.Error) { button = ( @@ -61,14 +61,14 @@ export default class ServerOfflineDialog extends React.PureComponent { ); } return ( -
    +
    {t.auditName} {button}
    ); }); return ( -
    +
    {formatTime(c.firstFailedTime, SettingsStore.getValue("showTwelveHourTimestamps"))}
    diff --git a/apps/web/src/components/views/dialogs/ServerPickerDialog.tsx b/apps/web/src/components/views/dialogs/ServerPickerDialog.tsx index e62e3e90c7e..02748fb4a2c 100644 --- a/apps/web/src/components/views/dialogs/ServerPickerDialog.tsx +++ b/apps/web/src/components/views/dialogs/ServerPickerDialog.tsx @@ -158,7 +158,7 @@ export default class ServerPickerDialog extends React.PureComponent { button: _t("action|sign_out"), danger: true, }); - finished.then(([ok]) => this.props.onFinished(ok)); + void finished.then(([ok]) => this.props.onFinished(ok)); }; private onRefreshClick = (): void => { diff --git a/apps/web/src/components/views/dialogs/SetEmailDialog.tsx b/apps/web/src/components/views/dialogs/SetEmailDialog.tsx index 5628df33ab6..dd8faff670a 100644 --- a/apps/web/src/components/views/dialogs/SetEmailDialog.tsx +++ b/apps/web/src/components/views/dialogs/SetEmailDialog.tsx @@ -71,7 +71,7 @@ export default class SetEmailDialog extends React.Component { description: _t("auth|set_email|verification_pending_description"), button: _t("action|continue"), }); - finished.then(([ok]) => this.onEmailDialogFinished(ok)); + void finished.then(([ok]) => this.onEmailDialogFinished(ok)); }, (err) => { this.setState({ emailBusy: false }); @@ -120,7 +120,7 @@ export default class SetEmailDialog extends React.Component { description: message, button: _t("action|continue"), }); - finished.then(([ok]) => this.onEmailDialogFinished(ok)); + void finished.then(([ok]) => this.onEmailDialogFinished(ok)); } else { logger.error("Unable to verify email address: " + err); Modal.createDialog(ErrorDialog, { diff --git a/apps/web/src/components/views/dialogs/SpacePreferencesDialog.tsx b/apps/web/src/components/views/dialogs/SpacePreferencesDialog.tsx index a2ca0034f54..5bbf7d9b20b 100644 --- a/apps/web/src/components/views/dialogs/SpacePreferencesDialog.tsx +++ b/apps/web/src/components/views/dialogs/SpacePreferencesDialog.tsx @@ -39,7 +39,7 @@ const SpacePreferencesAppearanceTab: React.FC> = ({ space ) => { - SettingsStore.setValue( + void SettingsStore.setValue( "Spaces.showPeopleInSpace", space.roomId, SettingLevel.ROOM_ACCOUNT, diff --git a/apps/web/src/components/views/dialogs/TextInputDialog.tsx b/apps/web/src/components/views/dialogs/TextInputDialog.tsx index ed076bc4720..c64cd48d09c 100644 --- a/apps/web/src/components/views/dialogs/TextInputDialog.tsx +++ b/apps/web/src/components/views/dialogs/TextInputDialog.tsx @@ -74,7 +74,7 @@ export default class TextInputDialog extends React.Component { if (!this.field.current.state.valid) { this.field.current.focus(); - this.field.current.validate({ allowEmpty: false, focused: true }); + void this.field.current.validate({ allowEmpty: false, focused: true }); this.setState({ busy: false }); return; } diff --git a/apps/web/src/components/views/dialogs/VerificationRequestDialog.tsx b/apps/web/src/components/views/dialogs/VerificationRequestDialog.tsx index 9414c9107b7..df73ea74640 100644 --- a/apps/web/src/components/views/dialogs/VerificationRequestDialog.tsx +++ b/apps/web/src/components/views/dialogs/VerificationRequestDialog.tsx @@ -51,7 +51,7 @@ export default class VerificationRequestDialog extends React.Component { + void this.props.verificationRequestPromise?.then((r) => { // The request promise completed, so we have a new request // Stop listening to the old request (if we have one, which normally we won't) diff --git a/apps/web/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx b/apps/web/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx index 157761e2176..c5bfe7bedff 100644 --- a/apps/web/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx +++ b/apps/web/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx @@ -92,11 +92,11 @@ export default class WidgetCapabilitiesPromptDialog extends React.PureComponent< // Both are the same type (both timeline or both non-timeline), sort lexicographically return lexicographicCompare(capA, capB); }); - const checkboxRows = orderedCapabilities.map(([cap, isChecked], i) => { + const checkboxRows = orderedCapabilities.map(([cap, isChecked]) => { const text = CapabilityText.for(cap, this.props.widgetKind); return ( -
    +
    this.onToggle(cap)} diff --git a/apps/web/src/components/views/dialogs/devtools/BaseTool.tsx b/apps/web/src/components/views/dialogs/devtools/BaseTool.tsx index 09120ecde26..e2eaefd1aa3 100644 --- a/apps/web/src/components/views/dialogs/devtools/BaseTool.tsx +++ b/apps/web/src/components/views/dialogs/devtools/BaseTool.tsx @@ -54,7 +54,7 @@ const BaseTool: React.FC> = ({ children = message; } else if (onAction && actionLabel) { const onActionClick = (): void => { - onAction().then((msg) => { + void onAction().then((msg) => { if (typeof msg === "string") { setMessage(msg); } diff --git a/apps/web/src/components/views/dialogs/devtools/Event.tsx b/apps/web/src/components/views/dialogs/devtools/Event.tsx index d8aeee932cf..27d42ab0083 100644 --- a/apps/web/src/components/views/dialogs/devtools/Event.tsx +++ b/apps/web/src/components/views/dialogs/devtools/Event.tsx @@ -101,7 +101,7 @@ export const EventEditor: React.FC = ({ fieldDefs, defaultCon if (!valid) { contentField.current?.focus(); - contentField.current?.validate({ focused: true }); + void contentField.current?.validate({ focused: true }); return; } diff --git a/apps/web/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx b/apps/web/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx index 1b241f4c23e..b90944cbaa1 100644 --- a/apps/web/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx +++ b/apps/web/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx @@ -127,7 +127,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent | React.MouseEvent): Promise => { diff --git a/apps/web/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx b/apps/web/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx index c221c994485..d6ec6973f3e 100644 --- a/apps/web/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx +++ b/apps/web/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx @@ -84,7 +84,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent { @@ -109,7 +109,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent { this.props.onFinished(false); - accessSecretStorage(async (): Promise => {}, { forceReset: true }); + void accessSecretStorage(async (): Promise => {}, { forceReset: true }); }; /** diff --git a/apps/web/src/components/views/dialogs/spotlight/SpotlightDialog.tsx b/apps/web/src/components/views/dialogs/spotlight/SpotlightDialog.tsx index 6215daaf00d..2deaacc6c87 100644 --- a/apps/web/src/components/views/dialogs/spotlight/SpotlightDialog.tsx +++ b/apps/web/src/components/views/dialogs/spotlight/SpotlightDialog.tsx @@ -349,7 +349,8 @@ const SpotlightDialog: React.FC = ({ initialText = "", initialFilter = n const [supportsSpaceFiltering, setSupportsSpaceFiltering] = useState(true); // assume it does until we find out it doesn't useEffect(() => { - cli.isVersionSupported("v1.4") + void cli + .isVersionSupported("v1.4") .then((supported) => { return supported || cli.doesServerSupportUnstableFeature("org.matrix.msc3827.stable"); }) @@ -565,7 +566,7 @@ const SpotlightDialog: React.FC = ({ initialText = "", initialFilter = n recents.delete(room.roomId); recents.add(room.roomId); - SettingsStore.setValue( + void SettingsStore.setValue( "SpotlightSearch.recentSearches", null, SettingLevel.ACCOUNT, @@ -686,7 +687,7 @@ const SpotlightDialog: React.FC = ({ initialText = "", initialFilter = n id={`mx_SpotlightDialog_button_result_${result.member.userId}`} key={`${Section[result.section]}-${result.member.userId}`} onClick={() => { - startDmOnFirstMessage(cli, [result.member]); + void startDmOnFirstMessage(cli, [result.member]); onFinished(); }} aria-label={ @@ -974,7 +975,7 @@ const SpotlightDialog: React.FC = ({ initialText = "", initialFilter = n className="mx_SpotlightDialog_inviteLink" onClick={() => { setInviteLinkCopied(true); - copyPlaintext(ownInviteLink); + void copyPlaintext(ownInviteLink); }} onTooltipOpenChange={(open) => { if (!open) setInviteLinkCopied(false); diff --git a/apps/web/src/components/views/directory/NetworkDropdown.tsx b/apps/web/src/components/views/directory/NetworkDropdown.tsx index e1545f7f77d..1ded6a24134 100644 --- a/apps/web/src/components/views/directory/NetworkDropdown.tsx +++ b/apps/web/src/components/views/directory/NetworkDropdown.tsx @@ -96,7 +96,7 @@ function useSettingsValueWithSetter( const setter = useCallback( async (value: Settings[S]["default"]): Promise => { setValue(value); - SettingsStore.setValue(settingName, roomId, level, value); + await SettingsStore.setValue(settingName, roomId, level, value); }, [level, roomId, settingName], ); diff --git a/apps/web/src/components/views/elements/AppTile.tsx b/apps/web/src/components/views/elements/AppTile.tsx index f3a7994f65b..72a6f12e8ac 100644 --- a/apps/web/src/components/views/elements/AppTile.tsx +++ b/apps/web/src/components/views/elements/AppTile.tsx @@ -319,7 +319,7 @@ export default class AppTile extends React.Component { } private onAllowedWidgetsChange = (): void => { - this.resolvePermissionToLoad(this.props).then((hasPermissionToLoad) => { + void this.resolvePermissionToLoad(this.props).then((hasPermissionToLoad) => { if (this.unmounted) return; if (this.state.hasPermissionToLoad && !hasPermissionToLoad) { @@ -378,7 +378,7 @@ export default class AppTile extends React.Component { // Sync check already approved — start immediately, no need to re-check. this.startWidget(); } else { - this.resolvePermissionToLoad(this.props).then((hasPermissionToLoad) => { + void this.resolvePermissionToLoad(this.props).then((hasPermissionToLoad) => { if (this.unmounted) return; this.setState({ hasPermissionToLoad }); if (hasPermissionToLoad) { @@ -469,7 +469,7 @@ export default class AppTile extends React.Component { } private startWidget(): void { - this.messaging?.prepare().then(() => { + void this.messaging?.prepare().then(() => { if (this.unmounted) return; this.setState({ initialising: false }); }); diff --git a/apps/web/src/components/views/elements/EffectsOverlay.tsx b/apps/web/src/components/views/elements/EffectsOverlay.tsx index 6c154d218af..e49f1cdaa68 100644 --- a/apps/web/src/components/views/elements/EffectsOverlay.tsx +++ b/apps/web/src/components/views/elements/EffectsOverlay.tsx @@ -49,7 +49,7 @@ const EffectsOverlay: FunctionComponent = ({ roomWidth }) => { const isOutdated = isEventOutdated(payload.event); if (canvasRef.current && payload.action.startsWith(actionPrefix) && !isOutdated) { const effect = payload.action.slice(actionPrefix.length); - lazyLoadEffectModule(effect).then((module) => module?.start(canvasRef.current!)); + void lazyLoadEffectModule(effect).then((module) => module?.start(canvasRef.current!)); } }; const dispatcherRef = dis.register(onAction); @@ -64,7 +64,7 @@ const EffectsOverlay: FunctionComponent = ({ roomWidth }) => { for (const effect in currentEffects) { const effectModule: ICanvasEffect = currentEffects.get(effect)!; if (effectModule && effectModule.isRunning) { - effectModule.stop(); + void effectModule.stop(); } } }; diff --git a/apps/web/src/components/views/elements/ErrorBoundary.tsx b/apps/web/src/components/views/elements/ErrorBoundary.tsx index ae5e3f93bf1..4d29e448734 100644 --- a/apps/web/src/components/views/elements/ErrorBoundary.tsx +++ b/apps/web/src/components/views/elements/ErrorBoundary.tsx @@ -52,7 +52,7 @@ export default class ErrorBoundary extends React.PureComponent { if (!PlatformPeg.get()) return; MatrixClientPeg.safeGet().stopClient(); - MatrixClientPeg.safeGet() + void MatrixClientPeg.safeGet() .store.deleteAllData() .then(() => { PlatformPeg.get()?.reload(); diff --git a/apps/web/src/components/views/elements/Field.tsx b/apps/web/src/components/views/elements/Field.tsx index 71e6d91f682..b765ec14e82 100644 --- a/apps/web/src/components/views/elements/Field.tsx +++ b/apps/web/src/components/views/elements/Field.tsx @@ -152,7 +152,7 @@ export default class Field extends React.PureComponent { * fields, in which case we can add some options to control it. */ private validateOnChange = debounce(() => { - this.validate({ + void this.validate({ focused: true, }); }, VALIDATION_THROTTLE_MS); @@ -180,7 +180,7 @@ export default class Field extends React.PureComponent { focused: true, }); if (this.props.validateOnFocus) { - this.validate({ + void this.validate({ focused: true, }); } @@ -201,7 +201,7 @@ export default class Field extends React.PureComponent { focused: false, }); if (this.props.validateOnBlur) { - this.validate({ + void this.validate({ focused: false, }); } diff --git a/apps/web/src/components/views/elements/IRCTimelineProfileResizer.tsx b/apps/web/src/components/views/elements/IRCTimelineProfileResizer.tsx index 90a86ab2587..a7d633d1d84 100644 --- a/apps/web/src/components/views/elements/IRCTimelineProfileResizer.tsx +++ b/apps/web/src/components/views/elements/IRCTimelineProfileResizer.tsx @@ -74,7 +74,7 @@ export default class IRCTimelineProfileResizer extends React.Component { if (this.props.roomId) { - SettingsStore.setValue( + void SettingsStore.setValue( "ircDisplayNameWidth", this.props.roomId, SettingLevel.ROOM_DEVICE, diff --git a/apps/web/src/components/views/elements/ImageView.tsx b/apps/web/src/components/views/elements/ImageView.tsx index 71578a09464..e1a3d667bb1 100644 --- a/apps/web/src/components/views/elements/ImageView.tsx +++ b/apps/web/src/components/views/elements/ImageView.tsx @@ -315,7 +315,7 @@ export default class ImageView extends React.Component { ev.preventDefault(); ev.stopPropagation(); if (this.downloadFunction) { - this.downloadFunction(); + void this.downloadFunction(); } break; } diff --git a/apps/web/src/components/views/elements/PollCreateDialog.tsx b/apps/web/src/components/views/elements/PollCreateDialog.tsx index f72c28f26e5..ecc20d87301 100644 --- a/apps/web/src/components/views/elements/PollCreateDialog.tsx +++ b/apps/web/src/components/views/elements/PollCreateDialog.tsx @@ -174,7 +174,7 @@ export default class PollCreateDialog extends ScrollableBaseModal { + void finished.then(([tryAgain]) => { if (!tryAgain) { this.cancel(); } else { @@ -215,7 +215,7 @@ export default class PollCreateDialog extends ScrollableBaseModal

    {_t("poll|options_heading")}

    {this.state.options.map((op, i) => ( -
    +
    = ({ data, className, ...options }) => { return; } let cancelled = false; - toDataURL(data, { ...defaultOptions, ...options }).then((uri) => { + void toDataURL(data, { ...defaultOptions, ...options }).then((uri) => { if (cancelled) return; setUri(uri); }); diff --git a/apps/web/src/components/views/elements/ReplyChain.tsx b/apps/web/src/components/views/elements/ReplyChain.tsx index ead388832c8..d27a05b89c6 100644 --- a/apps/web/src/components/views/elements/ReplyChain.tsx +++ b/apps/web/src/components/views/elements/ReplyChain.tsx @@ -86,7 +86,7 @@ export default class ReplyChain extends React.Component { public componentDidMount(): void { this.unmounted = false; - this.initialize(); + void this.initialize(); this.trySetExpandableQuotes(); } @@ -169,7 +169,7 @@ export default class ReplyChain extends React.Component { }; public collapse = (): void => { - this.initialize(); + void this.initialize(); }; private onQuoteClick = async (): Promise => { diff --git a/apps/web/src/components/views/elements/ServerPicker.tsx b/apps/web/src/components/views/elements/ServerPicker.tsx index fa25598c680..d7b61051649 100644 --- a/apps/web/src/components/views/elements/ServerPicker.tsx +++ b/apps/web/src/components/views/elements/ServerPicker.tsx @@ -32,7 +32,7 @@ const showPickerDialog = ( onFinished: (config?: ValidatedServerConfig) => void, ): void => { const { finished } = Modal.createDialog(ServerPickerDialog, { title, serverConfig }); - finished.then(([config]) => onFinished(config)); + void finished.then(([config]) => onFinished(config)); }; const onHelpClick = (): void => { diff --git a/apps/web/src/components/views/elements/SettingsDropdown.tsx b/apps/web/src/components/views/elements/SettingsDropdown.tsx index 85f448ea76b..487e9bc7e31 100644 --- a/apps/web/src/components/views/elements/SettingsDropdown.tsx +++ b/apps/web/src/components/views/elements/SettingsDropdown.tsx @@ -41,7 +41,7 @@ const SettingsDropdown = ({ const onOptionChange = useCallback( (value: string): void => { setValue(value); // local echo - SettingsStore.setValue(settingKey, roomId ?? null, level, value); + void SettingsStore.setValue(settingKey, roomId ?? null, level, value); onChange?.(value); }, [settingKey, roomId, level, onChange], diff --git a/apps/web/src/components/views/emojipicker/ReactionPicker.tsx b/apps/web/src/components/views/emojipicker/ReactionPicker.tsx index 11b3d9468af..4e1852c0ff8 100644 --- a/apps/web/src/components/views/emojipicker/ReactionPicker.tsx +++ b/apps/web/src/components/views/emojipicker/ReactionPicker.tsx @@ -92,7 +92,7 @@ class ReactionPicker extends React.Component { if (myReactions.hasOwnProperty(reaction)) { if (this.props.mxEvent.isRedacted() || !this.context.canSelfRedact) return false; - MatrixClientPeg.safeGet().redactEvent(this.props.mxEvent.getRoomId()!, myReactions[reaction]); + void MatrixClientPeg.safeGet().redactEvent(this.props.mxEvent.getRoomId()!, myReactions[reaction]); dis.dispatch({ action: Action.FocusAComposer, context: this.context.timelineRenderingType, @@ -100,7 +100,7 @@ class ReactionPicker extends React.Component { // Tell the emoji picker not to bump this in the more frequently used list. return false; } else { - MatrixClientPeg.safeGet().sendEvent(this.props.mxEvent.getRoomId()!, EventType.Reaction, { + void MatrixClientPeg.safeGet().sendEvent(this.props.mxEvent.getRoomId()!, EventType.Reaction, { "m.relates_to": { rel_type: RelationType.Annotation, event_id: this.props.mxEvent.getId()!, diff --git a/apps/web/src/components/views/location/LocationPicker.tsx b/apps/web/src/components/views/location/LocationPicker.tsx index dce5699fcc0..a961aa9de6d 100644 --- a/apps/web/src/components/views/location/LocationPicker.tsx +++ b/apps/web/src/components/views/location/LocationPicker.tsx @@ -191,7 +191,7 @@ class LocationPicker extends React.Component { private onOk = (): void => { const { timeout, position } = this.state; - this.props.onChoose( + void this.props.onChoose( position ? { uri: getGeoUri(position), timestamp: position.timestamp, timeout } : { diff --git a/apps/web/src/components/views/location/LocationShareMenu.tsx b/apps/web/src/components/views/location/LocationShareMenu.tsx index 453ad33cea0..1cbe545faf9 100644 --- a/apps/web/src/components/views/location/LocationShareMenu.tsx +++ b/apps/web/src/components/views/location/LocationShareMenu.tsx @@ -63,7 +63,7 @@ const LocationShareMenu: React.FC = ({ menuPosition, onFinished, sender, : shareLocation(matrixClient, roomId, shareType ?? LocationShareType.Own, relation, openMenu); const onLiveShareEnableSubmit = (): void => { - SettingsStore.setValue("feature_location_share_live", null, SettingLevel.DEVICE, true); + void SettingsStore.setValue("feature_location_share_live", null, SettingLevel.DEVICE, true); }; const shouldAdvertiseLiveLabsFlag = shareType === LocationShareType.Live && !isLiveShareEnabled; diff --git a/apps/web/src/components/views/messages/CallEvent.tsx b/apps/web/src/components/views/messages/CallEvent.tsx index 85677bda8df..b10edf50255 100644 --- a/apps/web/src/components/views/messages/CallEvent.tsx +++ b/apps/web/src/components/views/messages/CallEvent.tsx @@ -114,7 +114,7 @@ const ActiveLoadedCallEvent = ({ mxEvent, call, ref }: ActiveLoadedCallEventProp const disconnect = useCallback( (ev: ButtonEvent) => { ev.preventDefault(); - call.disconnect(); + void call.disconnect(); }, [call], ); diff --git a/apps/web/src/components/views/messages/CodeBlock.tsx b/apps/web/src/components/views/messages/CodeBlock.tsx index 04916a91402..39b0a081e3e 100644 --- a/apps/web/src/components/views/messages/CodeBlock.tsx +++ b/apps/web/src/components/views/messages/CodeBlock.tsx @@ -107,7 +107,7 @@ const CodeBlock: React.FC = ({ preNode }) => { } function highlightCodeRef(div: HTMLElement | null): void { - highlightCode(div); + void highlightCode(div); } let content = domToReact(preNode.children as DOMNode[]); diff --git a/apps/web/src/components/views/messages/MBeaconBody.tsx b/apps/web/src/components/views/messages/MBeaconBody.tsx index 48294296bed..000a14f864c 100644 --- a/apps/web/src/components/views/messages/MBeaconBody.tsx +++ b/apps/web/src/components/views/messages/MBeaconBody.tsx @@ -103,7 +103,7 @@ const useHandleBeaconRedaction = ( : undefined; relations?.getRelations()?.forEach((locationEvent) => { - matrixClient.redactEvent( + void matrixClient.redactEvent( locationEvent.getRoomId()!, locationEvent.getId()!, undefined, diff --git a/apps/web/src/components/views/messages/MImageReplyBody.tsx b/apps/web/src/components/views/messages/MImageReplyBody.tsx index 1f03cc5e592..7b8389f7be6 100644 --- a/apps/web/src/components/views/messages/MImageReplyBody.tsx +++ b/apps/web/src/components/views/messages/MImageReplyBody.tsx @@ -495,6 +495,7 @@ export class ImageBodyBaseInner extends React.Component {placeholder} diff --git a/apps/web/src/components/views/messages/MPollBody.tsx b/apps/web/src/components/views/messages/MPollBody.tsx index e925726a2a0..247c3334284 100644 --- a/apps/web/src/components/views/messages/MPollBody.tsx +++ b/apps/web/src/components/views/messages/MPollBody.tsx @@ -157,7 +157,7 @@ export default class MPollBody extends React.Component { const room = this.context?.getRoom(this.props.mxEvent.getRoomId()); const poll = room?.polls.get(this.props.mxEvent.getId()!); if (poll) { - this.setPollInstance(poll); + void this.setPollInstance(poll); } else { room?.on(PollEvent.New, this.setPollInstance.bind(this)); } diff --git a/apps/web/src/components/views/polls/pollHistory/PollListItemEnded.tsx b/apps/web/src/components/views/polls/pollHistory/PollListItemEnded.tsx index 39d2d0e07d0..d179128d9e1 100644 --- a/apps/web/src/components/views/polls/pollHistory/PollListItemEnded.tsx +++ b/apps/web/src/components/views/polls/pollHistory/PollListItemEnded.tsx @@ -69,7 +69,7 @@ const usePollVotes = (poll: Poll): Partial => { setResults(getWinningAnswers(poll, responseRelations)); poll.on(PollEvent.Responses, onPollResponses); - getResponses(); + void getResponses(); return () => { poll.off(PollEvent.Responses, onPollResponses); diff --git a/apps/web/src/components/views/polls/pollHistory/fetchPastPolls.ts b/apps/web/src/components/views/polls/pollHistory/fetchPastPolls.ts index d25ef6bfae4..0842e27a6f5 100644 --- a/apps/web/src/components/views/polls/pollHistory/fetchPastPolls.ts +++ b/apps/web/src/components/views/polls/pollHistory/fetchPastPolls.ts @@ -203,7 +203,7 @@ export const useFetchPastPolls = ( setTimelineSet(timelineSet); }; - getFilteredTimelineSet(); + void getFilteredTimelineSet(); }, [room, matrixClient]); const { isLoading, oldestEventTimestamp, loadMorePolls, loadTimelineHistory } = useTimelineHistory( @@ -213,7 +213,7 @@ export const useFetchPastPolls = ( ); useEffect(() => { - loadTimelineHistory(); + void loadTimelineHistory(); }, [loadTimelineHistory]); return { isLoading, oldestEventTimestamp, loadMorePolls }; diff --git a/apps/web/src/components/views/polls/pollHistory/usePollHistory.ts b/apps/web/src/components/views/polls/pollHistory/usePollHistory.ts index fb0714863da..a8f90489882 100644 --- a/apps/web/src/components/views/polls/pollHistory/usePollHistory.ts +++ b/apps/web/src/components/views/polls/pollHistory/usePollHistory.ts @@ -68,7 +68,7 @@ export const usePollsWithRelations = ( poll.on(PollEvent.Responses, onPollUpdate); // trigger request to get all responses // if they are not already in cache - poll.getResponses(); + void poll.getResponses(); } setPollsWithRelations(polls); } diff --git a/apps/web/src/components/views/right_panel/EncryptionPanel.tsx b/apps/web/src/components/views/right_panel/EncryptionPanel.tsx index 82591742f11..f5b27641ef1 100644 --- a/apps/web/src/components/views/right_panel/EncryptionPanel.tsx +++ b/apps/web/src/components/views/right_panel/EncryptionPanel.tsx @@ -67,7 +67,7 @@ const EncryptionPanel: React.FC = (props: IProps) => { setPhase(requestFromPromise?.phase); } if (verificationRequestPromise) { - awaitPromise(); + void awaitPromise(); } }, [verificationRequestPromise]); // Use a ref to track whether we are already showing the mismatch modal as state may not update fast enough diff --git a/apps/web/src/components/views/right_panel/ExtensionsCard.tsx b/apps/web/src/components/views/right_panel/ExtensionsCard.tsx index c3db44e5013..229a05e14f4 100644 --- a/apps/web/src/components/views/right_panel/ExtensionsCard.tsx +++ b/apps/web/src/components/views/right_panel/ExtensionsCard.tsx @@ -152,7 +152,7 @@ const ExtensionsCard: React.FC = ({ room, onClose }) => { managers.openNoManagerDialog(); } else { // noinspection JSIgnoredPromiseFromCall - managers.getPrimaryManager()?.open(room); + void managers.getPrimaryManager()?.open(room); } }; diff --git a/apps/web/src/components/views/right_panel/PinnedMessagesCard.tsx b/apps/web/src/components/views/right_panel/PinnedMessagesCard.tsx index b2b4aa72cda..c39d865cba2 100644 --- a/apps/web/src/components/views/right_panel/PinnedMessagesCard.tsx +++ b/apps/web/src/components/views/right_panel/PinnedMessagesCard.tsx @@ -58,7 +58,7 @@ export function PinnedMessagesCard({ room, onClose, permalinkCreator }: PinnedMe const newlyRead = pinnedEventIds.filter((id) => !readPinnedEvents.has(id)); if (newlyRead.length > 0) { // clear out any read pinned events which no longer are pinned - cli.setRoomAccountData(room.roomId, ReadPinsEventId, { + void cli.setRoomAccountData(room.roomId, ReadPinsEventId, { event_ids: pinnedEventIds, }); } diff --git a/apps/web/src/components/views/right_panel/UserInfo.tsx b/apps/web/src/components/views/right_panel/UserInfo.tsx index 320ab48c233..9dfa2fdae94 100644 --- a/apps/web/src/components/views/right_panel/UserInfo.tsx +++ b/apps/web/src/components/views/right_panel/UserInfo.tsx @@ -132,7 +132,7 @@ export const useDevices = (userId: string): IDevice[] | undefined | null => { setDevices(null); } } - downloadDeviceList(); + void downloadDeviceList(); // Handle being unmounted return () => { @@ -150,11 +150,11 @@ export const useDevices = (userId: string): IDevice[] | undefined | null => { }; const onDevicesUpdated = (users: string[]): void => { if (!users.includes(userId)) return; - updateDevices(); + void updateDevices(); }; const onUserTrustStatusChanged = (_userId: string, trustLevel: UserVerificationStatus): void => { if (_userId !== userId) return; - updateDevices(); + void updateDevices(); }; cli.on(CryptoEvent.DevicesUpdated, onDevicesUpdated); cli.on(CryptoEvent.UserTrustStatusChanged, onUserTrustStatusChanged); diff --git a/apps/web/src/components/views/right_panel/VerificationPanel.tsx b/apps/web/src/components/views/right_panel/VerificationPanel.tsx index 73a23e4d4e5..daf7a76ea5d 100644 --- a/apps/web/src/components/views/right_panel/VerificationPanel.tsx +++ b/apps/web/src/components/views/right_panel/VerificationPanel.tsx @@ -351,7 +351,7 @@ export default class VerificationPanel extends React.PureComponent { - this.state.sasEvent?.confirm(); + void this.state.sasEvent?.confirm(); }; private onSasMismatchesClick = (): void => { @@ -372,7 +372,7 @@ export default class VerificationPanel extends React.PureComponent { ev.preventDefault(); - vm.onKickClick(); + void vm.onKickClick(); }} disabled={isUpdating} label={vm.kickLabel} @@ -94,7 +94,7 @@ export const BanToggleButton = ({ role="button" onSelect={async (ev) => { ev.preventDefault(); - vm.onBanOrUnbanClick(); + void vm.onBanOrUnbanClick(); }} disabled={isUpdating} label={vm.banLabel} @@ -128,7 +128,7 @@ const MuteToggleButton: React.FC = ({ role="button" onSelect={async (ev) => { ev.preventDefault(); - vm.onMuteButtonClick(); + void vm.onMuteButtonClick(); }} disabled={isUpdating} label={vm.muteLabel} diff --git a/apps/web/src/components/views/right_panel/user_info/UserInfoBasicOptionsView.tsx b/apps/web/src/components/views/right_panel/user_info/UserInfoBasicOptionsView.tsx index cd80d77d857..cc0aece3d88 100644 --- a/apps/web/src/components/views/right_panel/user_info/UserInfoBasicOptionsView.tsx +++ b/apps/web/src/components/views/right_panel/user_info/UserInfoBasicOptionsView.tsx @@ -88,7 +88,7 @@ export const UserInfoBasicOptionsView: React.FC<{ role="button" onSelect={async (ev) => { ev.preventDefault(); - vm.onInviteUserButton(room.roomId, ev); + void vm.onInviteUserButton(room.roomId, ev); }} label={_t("action|invite")} Icon={InviteIcon} diff --git a/apps/web/src/components/views/room_settings/AliasSettings.tsx b/apps/web/src/components/views/room_settings/AliasSettings.tsx index 1633cfeb623..b7c420c709c 100644 --- a/apps/web/src/components/views/room_settings/AliasSettings.tsx +++ b/apps/web/src/components/views/room_settings/AliasSettings.tsx @@ -50,7 +50,7 @@ class EditableAliasesList extends EditableItemList { } this.aliasField.current.focus(); - this.aliasField.current.validate({ allowEmpty: false, focused: true }); + await this.aliasField.current.validate({ allowEmpty: false, focused: true }); }; protected renderNewItemField(): JSX.Element { @@ -136,7 +136,7 @@ export default class AliasSettings extends React.Component { if (this.props.canSetCanonicalAlias) { // load local aliases for providing recommendations // for the canonical alias and alt_aliases - this.loadLocalAliases(); + void this.loadLocalAliases(); } } @@ -290,7 +290,7 @@ export default class AliasSettings extends React.Component { if (event.currentTarget.open) { // if local aliases haven't been preloaded yet at component mount if (!this.props.canSetCanonicalAlias && this.state.localAliases.length === 0) { - this.loadLocalAliases(); + void this.loadLocalAliases(); } } this.setState({ detailsOpen: event.currentTarget.open }); @@ -347,10 +347,10 @@ export default class AliasSettings extends React.Component { - {this.getAliases().map((alias, i) => { + {this.getAliases().map((alias) => { if (alias === this.state.canonicalAlias) found = true; return ( - ); @@ -414,7 +414,7 @@ export default class AliasSettings extends React.Component { )} {this.getLocalNonAltAliases().map((alias) => { - return { + void client.getRoomDirectoryVisibility(this.props.roomId).then((result) => { this.setState({ isRoomPublished: result.visibility === "public" }); }); } diff --git a/apps/web/src/components/views/rooms/Autocomplete.tsx b/apps/web/src/components/views/rooms/Autocomplete.tsx index a7a211e8289..39982ab942a 100644 --- a/apps/web/src/components/views/rooms/Autocomplete.tsx +++ b/apps/web/src/components/views/rooms/Autocomplete.tsx @@ -92,7 +92,7 @@ export default class Autocomplete extends React.PureComponent { return; } - this.complete(this.props.query, this.props.selection); + void this.complete(this.props.query, this.props.selection); } public componentWillUnmount(): void { @@ -239,7 +239,7 @@ export default class Autocomplete extends React.PureComponent { hide: false, }, () => { - this.complete(this.props.query, this.props.selection).then(() => { + void this.complete(this.props.query, this.props.selection).then(() => { resolve(this.countCompletions()); }); }, @@ -314,7 +314,11 @@ export default class Autocomplete extends React.PureComponent { }); return completions.length > 0 ? ( -
    +
    {completionResult.provider.getName()}
    {completionResult.provider.renderCompletions(completions)}
    diff --git a/apps/web/src/components/views/rooms/BasicMessageComposer.tsx b/apps/web/src/components/views/rooms/BasicMessageComposer.tsx index 73816f09614..c1f01198358 100644 --- a/apps/web/src/components/views/rooms/BasicMessageComposer.tsx +++ b/apps/web/src/components/views/rooms/BasicMessageComposer.tsx @@ -290,7 +290,7 @@ export default class BasicMessageEditor extends React.Component if (this.isSafari) { this.onInput({ inputType: "insertCompositionText" }); } else { - Promise.resolve().then(() => { + void Promise.resolve().then(() => { this.onInput({ inputType: "insertCompositionText" }); }); } @@ -388,7 +388,7 @@ export default class BasicMessageEditor extends React.Component this.modifiedFlag = true; const sel = document.getSelection()!; const { caret, text } = getCaretOffsetAndText(this.editorRef.current, sel); - this.props.model.update(text, event.inputType, caret); + void this.props.model.update(text, event.inputType, caret); }; private insertText(textToInsert: string, inputType = "insertText"): void { @@ -398,7 +398,7 @@ export default class BasicMessageEditor extends React.Component const newText = text.slice(0, caret.offset) + textToInsert + text.slice(caret.offset); caret.offset += textToInsert.length; this.modifiedFlag = true; - this.props.model.update(newText, inputType, caret); + void this.props.model.update(newText, inputType, caret); } // this is used later to see if we need to recalculate the caret @@ -553,7 +553,7 @@ export default class BasicMessageEditor extends React.Component } } else if (autocompleteAction === KeyBindingAction.ForceCompleteAutocomplete && !this.state.showVisualBell) { // there is no current autocomplete window, try to open it - this.tabCompleteName(); + void this.tabCompleteName(); handled = true; } else if ([KeyBindingAction.Delete, KeyBindingAction.Backspace].includes(accessibilityAction!)) { this.formatBarRef.current?.hide(); @@ -885,7 +885,7 @@ export default class BasicMessageEditor extends React.Component const position = model.positionForOffset(caret.offset, caret.atNodeEnd); // Insert suffix only if the caret is at the start of the composer const parts = partCreator.createMentionParts(caret.offset === 0, displayName, userId); - model.transform(() => { + void model.transform(() => { const addedLen = model.insert(parts, position); return model.positionForOffset(caret.offset + addedLen, true); }); @@ -901,7 +901,7 @@ export default class BasicMessageEditor extends React.Component // add two newlines quoteParts.push(partCreator.newline()); quoteParts.push(partCreator.newline()); - model.transform(() => { + void model.transform(() => { const addedLen = model.insert(quoteParts, model.positionForOffset(0)); return model.positionForOffset(addedLen, true); }); @@ -915,7 +915,7 @@ export default class BasicMessageEditor extends React.Component const { partCreator } = model; const caret = this.getCaret(); const position = model.positionForOffset(caret.offset, caret.atNodeEnd); - model.transform(() => { + void model.transform(() => { const addedLen = model.insert(partCreator.plainWithEmoji(text), position); return model.positionForOffset(caret.offset + addedLen, true); }); diff --git a/apps/web/src/components/views/rooms/EditMessageComposer.tsx b/apps/web/src/components/views/rooms/EditMessageComposer.tsx index 970d8cffcd9..44e24ceecec 100644 --- a/apps/web/src/components/views/rooms/EditMessageComposer.tsx +++ b/apps/web/src/components/views/rooms/EditMessageComposer.tsx @@ -137,7 +137,7 @@ class EditMessageComposer extends React.Component this.props.mxEvent.on(ThreadEvent.Update, this.updateThread); - client.decryptEventIfNeeded(this.props.mxEvent); + void client.decryptEventIfNeeded(this.props.mxEvent); const room = client.getRoom(this.props.mxEvent.getRoomId()); room?.on(ThreadEvent.New, this.onNewThread); diff --git a/apps/web/src/components/views/rooms/MessageComposer.tsx b/apps/web/src/components/views/rooms/MessageComposer.tsx index 86e577d1e20..9d855539ffd 100644 --- a/apps/web/src/components/views/rooms/MessageComposer.tsx +++ b/apps/web/src/components/views/rooms/MessageComposer.tsx @@ -318,7 +318,7 @@ export class MessageComposer extends React.Component { // Otherwise, wait for member loading to finish and then update the member for the avatar. // The members should already be loading, and loadMembersIfNeeded // will return the promise for the existing operation - this.props.room.loadMembersIfNeeded().then(() => { + void this.props.room.loadMembersIfNeeded().then(() => { const me = this.props.room.getMember(MatrixClientPeg.safeGet().getSafeUserId()) ?? undefined; this.setState({ me }); }); @@ -403,7 +403,7 @@ export class MessageComposer extends React.Component { return; } - this.messageComposerInput.current?.sendMessage(); + void this.messageComposerInput.current?.sendMessage(); if (this.state.isWysiwygLabEnabled) { const { relation, replyToEvent } = this.props; @@ -530,7 +530,7 @@ export class MessageComposer extends React.Component { } private onRecordStartEndClick = (): void => { - this.voiceRecordingButton.current?.onRecordStartEndClick(); + void this.voiceRecordingButton.current?.onRecordStartEndClick(); if (this.context.narrow) { this.toggleButtonMenu(); diff --git a/apps/web/src/components/views/rooms/PinnedMessageBanner.tsx b/apps/web/src/components/views/rooms/PinnedMessageBanner.tsx index 0c1f72cf8e5..40045e46ae1 100644 --- a/apps/web/src/components/views/rooms/PinnedMessageBanner.tsx +++ b/apps/web/src/components/views/rooms/PinnedMessageBanner.tsx @@ -219,6 +219,7 @@ function Indicators({ count, currentIndex }: IndicatorsProps): JSX.Element { return (
    {Array.from({ length: numberOfIndicators }).map((_, i) => ( + // oxlint-disable-next-line react/no-array-index-key
    diff --git a/apps/web/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx b/apps/web/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx index 101a1afdf95..98337ae411b 100644 --- a/apps/web/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx +++ b/apps/web/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx @@ -67,7 +67,7 @@ export const CallGuestLinkButton: React.FC<{ room: Room }> = ({ room }) => { showLinkModal(); } else { // the room needs to be set to public or knock to generate a link - Modal.createDialog(JoinRuleDialog, { + void Modal.createDialog(JoinRuleDialog, { room, // If the user cannot invite the Knocking is not given as an option. canInvite, diff --git a/apps/web/src/components/views/rooms/RoomPreviewBar.tsx b/apps/web/src/components/views/rooms/RoomPreviewBar.tsx index 1a0195a68c8..57fc54014f7 100644 --- a/apps/web/src/components/views/rooms/RoomPreviewBar.tsx +++ b/apps/web/src/components/views/rooms/RoomPreviewBar.tsx @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com Please see LICENSE files in the repository root for full details. */ -import React, { type JSX, type ChangeEvent, type ReactNode } from "react"; +import React, { type JSX, type ChangeEvent } from "react"; import { type Room, type RoomMember, EventType, RoomType, JoinRule, type MatrixError } from "matrix-js-sdk/src/matrix"; import { KnownMembership, type RoomJoinRulesEventContent } from "matrix-js-sdk/src/types"; import classNames from "classnames"; @@ -127,12 +127,12 @@ class RoomPreviewBar extends React.Component { } public componentDidMount(): void { - this.checkInvitedEmail(); + void this.checkInvitedEmail(); } public componentDidUpdate(prevProps: IProps, prevState: IState): void { if (this.props.invitedEmail !== prevProps.invitedEmail || this.props.inviterName !== prevProps.inviterName) { - this.checkInvitedEmail(); + void this.checkInvitedEmail(); } } @@ -655,6 +655,7 @@ class RoomPreviewBar extends React.Component { if (!Array.isArray(subTitle)) { subTitle = [subTitle]; } + // oxlint-disable-next-line react/no-array-index-key subTitleElements = subTitle.map((t, i) =>

    {t}

    ); } diff --git a/apps/web/src/components/views/rooms/SendMessageComposer.tsx b/apps/web/src/components/views/rooms/SendMessageComposer.tsx index 922cbdac267..0cc25450576 100644 --- a/apps/web/src/components/views/rooms/SendMessageComposer.tsx +++ b/apps/web/src/components/views/rooms/SendMessageComposer.tsx @@ -196,7 +196,7 @@ export class SendMessageComposer extends React.Component { + void prom.then((resp) => { sendRoundTripMetric(this.props.mxClient, roomId, resp.event_id); }); } @@ -568,7 +568,7 @@ export class SendMessageComposer extends React.Component { console.log(error); diff --git a/apps/web/src/components/views/rooms/Stickerpicker.tsx b/apps/web/src/components/views/rooms/Stickerpicker.tsx index 7bfe34b9380..5df894e886d 100644 --- a/apps/web/src/components/views/rooms/Stickerpicker.tsx +++ b/apps/web/src/components/views/rooms/Stickerpicker.tsx @@ -328,7 +328,7 @@ export default class Stickerpicker extends React.PureComponent { */ private launchManageIntegrations = (): void => { // noinspection JSIgnoredPromiseFromCall - IntegrationManagers.sharedInstance() + void IntegrationManagers.sharedInstance() ?.getPrimaryManager() ?.open(this.props.room, `type_${WidgetType.STICKERPICKER.preferred}`, this.state.widgetId ?? undefined); }; diff --git a/apps/web/src/components/views/rooms/VoiceRecordComposerTile.tsx b/apps/web/src/components/views/rooms/VoiceRecordComposerTile.tsx index 48e7ff4c859..510c7c4a1d4 100644 --- a/apps/web/src/components/views/rooms/VoiceRecordComposerTile.tsx +++ b/apps/web/src/components/views/rooms/VoiceRecordComposerTile.tsx @@ -133,7 +133,7 @@ export default class VoiceRecordComposerTile extends React.PureComponent MatrixClientPeg.safeGet().sendMessage(actualRoomId, content), this.props.room.client, @@ -205,7 +205,7 @@ export default class VoiceRecordComposerTile extends React.PureComponent composerFunctions.insertText(payload.text)); + void setSelection(composerContext.selection).then(() => + composerFunctions.insertText(payload.text), + ); } break; } diff --git a/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygSendActionHandler.ts b/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygSendActionHandler.ts index fcab8f4547d..6c547fbcd77 100644 --- a/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygSendActionHandler.ts +++ b/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygSendActionHandler.ts @@ -59,7 +59,9 @@ export function useWysiwygSendActionHandler( } else if (payload.event) { // TODO insert quote message - see SendMessageComposer } else if (payload.text) { - setSelection(composerContext.selection).then(() => composerFunctions.insertText(payload.text)); + void setSelection(composerContext.selection).then(() => + composerFunctions.insertText(payload.text), + ); } break; } diff --git a/apps/web/src/components/views/rooms/wysiwyg_composer/utils/message.ts b/apps/web/src/components/views/rooms/wysiwyg_composer/utils/message.ts index a755ba007d0..3a9dbc79de2 100644 --- a/apps/web/src/components/views/rooms/wysiwyg_composer/utils/message.ts +++ b/apps/web/src/components/views/rooms/wysiwyg_composer/utils/message.ts @@ -156,7 +156,7 @@ export async function sendMessage( } }); if (SettingsStore.getValue("Performance.addSendMessageTimingMetadata")) { - prom.then((resp) => { + void prom.then((resp) => { sendRoundTripMetric(mxClient, roomId, resp.event_id); }); } diff --git a/apps/web/src/components/views/settings/AddRemoveThreepids.tsx b/apps/web/src/components/views/settings/AddRemoveThreepids.tsx index 301afd4d414..d7ad9b507a2 100644 --- a/apps/web/src/components/views/settings/AddRemoveThreepids.tsx +++ b/apps/web/src/components/views/settings/AddRemoveThreepids.tsx @@ -120,7 +120,7 @@ const ExistingThreepid: React.FC = ({ mode, threepid, onC (e: ButtonEvent): void => { e.stopPropagation(); e.preventDefault(); - changeBinding({ + void changeBinding({ bind: false, label: "revoke", errorTitle: @@ -136,7 +136,7 @@ const ExistingThreepid: React.FC = ({ mode, threepid, onC (e: ButtonEvent): void => { e.stopPropagation(); e.preventDefault(); - changeBinding({ + void changeBinding({ bind: true, label: "share", errorTitle: diff --git a/apps/web/src/components/views/settings/EventIndexPanel.tsx b/apps/web/src/components/views/settings/EventIndexPanel.tsx index 4cd7a7d015a..5433a02376a 100644 --- a/apps/web/src/components/views/settings/EventIndexPanel.tsx +++ b/apps/web/src/components/views/settings/EventIndexPanel.tsx @@ -62,7 +62,7 @@ export default class EventIndexPanel extends React.Component { @@ -120,7 +120,7 @@ export default class EventIndexPanel extends React.Component { const { finished, close } = Modal.createDialog(SeshatResetDialog); - finished.then(async ([success]) => { + void finished.then(async ([success]) => { if (success) { await SettingsStore.setValue("enableEventIndexing", null, SettingLevel.DEVICE, false); await EventIndexPeg.deleteEventIndex(); diff --git a/apps/web/src/components/views/settings/ImageSizePanel.tsx b/apps/web/src/components/views/settings/ImageSizePanel.tsx index 1b4e5e711fc..e01134a8c7a 100644 --- a/apps/web/src/components/views/settings/ImageSizePanel.tsx +++ b/apps/web/src/components/views/settings/ImageSizePanel.tsx @@ -36,7 +36,7 @@ export default class ImageSizePanel extends React.Component this.setState({ size: newSize }); // noinspection JSIgnoredPromiseFromCall - SettingsStore.setValue("Images.size", null, SettingLevel.ACCOUNT, newSize); + void SettingsStore.setValue("Images.size", null, SettingLevel.ACCOUNT, newSize); }; public render(): React.ReactNode { diff --git a/apps/web/src/components/views/settings/JoinRuleSettings.tsx b/apps/web/src/components/views/settings/JoinRuleSettings.tsx index 86ef7af7a62..ae1b0ba0ccc 100644 --- a/apps/web/src/components/views/settings/JoinRuleSettings.tsx +++ b/apps/web/src/components/views/settings/JoinRuleSettings.tsx @@ -258,7 +258,7 @@ const JoinRuleSettings: React.FC = ({ if (restrictedAllowRoomIds.length > 0) { onRestrictedRoomIdsChange(restrictedAllowRoomIds); } else { - onChange(JoinRule.Invite); + void onChange(JoinRule.Invite); } }; diff --git a/apps/web/src/components/views/settings/LayoutSwitcher.tsx b/apps/web/src/components/views/settings/LayoutSwitcher.tsx index 5997c95707d..908e3e6cc6c 100644 --- a/apps/web/src/components/views/settings/LayoutSwitcher.tsx +++ b/apps/web/src/components/views/settings/LayoutSwitcher.tsx @@ -125,7 +125,7 @@ function useEventTileInfo(): EventTileInfo { }); }; - run(); + void run(); }, [userId, matrixClient, setEventTileInfo]); return eventTileInfo; } diff --git a/apps/web/src/components/views/settings/Notifications.tsx b/apps/web/src/components/views/settings/Notifications.tsx index 2cc2b535ad7..15f95ca0d19 100644 --- a/apps/web/src/components/views/settings/Notifications.tsx +++ b/apps/web/src/components/views/settings/Notifications.tsx @@ -237,8 +237,8 @@ export default class Notifications extends React.PureComponent, prevState: Readonly): void { if (this.state.deviceNotificationsEnabled !== prevState.deviceNotificationsEnabled) { - this.persistLocalNotificationSettings(this.state.deviceNotificationsEnabled); + void this.persistLocalNotificationSettings(this.state.deviceNotificationsEnabled); } } diff --git a/apps/web/src/components/views/settings/SetIdServer.tsx b/apps/web/src/components/views/settings/SetIdServer.tsx index 520c642172a..fddc28453ac 100644 --- a/apps/web/src/components/views/settings/SetIdServer.tsx +++ b/apps/web/src/components/views/settings/SetIdServer.tsx @@ -124,7 +124,7 @@ export default class SetIdServer extends React.Component { private saveIdServer = (fullUrl: string): void => { // Account data change will update localstorage, client, etc through dispatcher - MatrixClientPeg.safeGet().setAccountData("m.identity_server", { + void MatrixClientPeg.safeGet().setAccountData("m.identity_server", { base_url: fullUrl, }); this.setState({ @@ -311,7 +311,7 @@ export default class SetIdServer extends React.Component { private disconnectIdServer = (): void => { // Account data change will update localstorage, client, etc through dispatcher - MatrixClientPeg.safeGet().setAccountData("m.identity_server", { + void MatrixClientPeg.safeGet().setAccountData("m.identity_server", { base_url: null, // clear }); diff --git a/apps/web/src/components/views/settings/UserPersonalInfoSettings.tsx b/apps/web/src/components/views/settings/UserPersonalInfoSettings.tsx index ce4e4cb681d..8db48a56f56 100644 --- a/apps/web/src/components/views/settings/UserPersonalInfoSettings.tsx +++ b/apps/web/src/components/views/settings/UserPersonalInfoSettings.tsx @@ -68,7 +68,7 @@ export const UserPersonalInfoSettings: React.FC = }, [client]); useEffect(() => { - updateThreepids(); + void updateThreepids(); }, [updateThreepids]); if (!SettingsStore.getValue(UIFeature.ThirdPartyID)) return null; diff --git a/apps/web/src/components/views/settings/UserProfileSettings.tsx b/apps/web/src/components/views/settings/UserProfileSettings.tsx index d2280c3a33c..17dcaf6ed46 100644 --- a/apps/web/src/components/views/settings/UserProfileSettings.tsx +++ b/apps/web/src/components/views/settings/UserProfileSettings.tsx @@ -128,7 +128,7 @@ const UserProfileSettings: React.FC = ({ const client = useMatrixClientContext(); useEffect(() => { - (async () => { + void (async () => { try { const mediaConfig = await client.getMediaConfig(); setMaxUploadSize(mediaConfig["m.upload.size"]); diff --git a/apps/web/src/components/views/settings/devices/DeviceDetails.tsx b/apps/web/src/components/views/settings/devices/DeviceDetails.tsx index 35a14084a43..02523fc789a 100644 --- a/apps/web/src/components/views/settings/devices/DeviceDetails.tsx +++ b/apps/web/src/components/views/settings/devices/DeviceDetails.tsx @@ -127,10 +127,10 @@ const DeviceDetails: React.FC = ({ {!accountManagementEndpoint && (

    {_t("settings|sessions|details_heading")}

    - {metadata.map(({ heading, values, id }, index) => ( + {metadata.map(({ heading, values, id }) => ( {heading && ( diff --git a/apps/web/src/components/views/settings/devices/deleteDevices.tsx b/apps/web/src/components/views/settings/devices/deleteDevices.tsx index 894e23e0f7a..18e83a55b94 100644 --- a/apps/web/src/components/views/settings/devices/deleteDevices.tsx +++ b/apps/web/src/components/views/settings/devices/deleteDevices.tsx @@ -71,6 +71,6 @@ export const deleteDevicesWithInteractiveAuth = async ( [SSOAuthEntry.UNSTABLE_LOGIN_TYPE]: dialogAesthetics, }, }); - finished.then(([success]) => onFinished(success)); + await finished.then(([success]) => onFinished(success)); } }; diff --git a/apps/web/src/components/views/settings/devices/useOwnDevices.ts b/apps/web/src/components/views/settings/devices/useOwnDevices.ts index 34aec1c0123..145670674b1 100644 --- a/apps/web/src/components/views/settings/devices/useOwnDevices.ts +++ b/apps/web/src/components/views/settings/devices/useOwnDevices.ts @@ -100,7 +100,7 @@ export const useOwnDevices = (): DevicesState => { const [error, setError] = useState(); useEffect(() => { - matrixClient.doesServerSupportUnstableFeature("org.matrix.msc3881").then((hasSupport) => { + void matrixClient.doesServerSupportUnstableFeature("org.matrix.msc3881").then((hasSupport) => { setSupportsMSC3881(hasSupport); }); }, [matrixClient]); @@ -153,7 +153,7 @@ export const useOwnDevices = (): DevicesState => { }, [matrixClient]); useEffect(() => { - refreshDevices(); + void refreshDevices(); }, [refreshDevices]); useEffect(() => { @@ -167,7 +167,7 @@ export const useOwnDevices = (): DevicesState => { useEventEmitter(matrixClient, CryptoEvent.DevicesUpdated, (users: string[]): void => { if (users.includes(userId)) { - refreshDevices(); + void refreshDevices(); } }); diff --git a/apps/web/src/components/views/settings/discovery/DiscoverySettings.tsx b/apps/web/src/components/views/settings/discovery/DiscoverySettings.tsx index db66c93888c..340bf15e253 100644 --- a/apps/web/src/components/views/settings/discovery/DiscoverySettings.tsx +++ b/apps/web/src/components/views/settings/discovery/DiscoverySettings.tsx @@ -73,7 +73,7 @@ export const DiscoverySettings: React.FC = () => { if (payload.action === "id_server_changed") { setIdServerName(abbreviateUrl(client.getIdentityServerUrl())); - getThreepidState(); + void getThreepidState(); } }, [client, getThreepidState], @@ -81,7 +81,7 @@ export const DiscoverySettings: React.FC = () => { ); useEffect(() => { - (async () => { + void (async () => { try { await getThreepidState(); diff --git a/apps/web/src/components/views/settings/encryption/ChangeRecoveryKey.tsx b/apps/web/src/components/views/settings/encryption/ChangeRecoveryKey.tsx index f62a429aa7a..7764380f031 100644 --- a/apps/web/src/components/views/settings/encryption/ChangeRecoveryKey.tsx +++ b/apps/web/src/components/views/settings/encryption/ChangeRecoveryKey.tsx @@ -366,7 +366,7 @@ function KeyForm({ onCancelClick, onSubmit, recoveryKey, submitButtonLabel }: Ke return; } setIsKeyChangeInProgress(true); - onSubmit().finally(() => { + void onSubmit().finally(() => { setIsKeyChangeInProgress(false); }); }} diff --git a/apps/web/src/components/views/settings/encryption/KeyStoragePanel.tsx b/apps/web/src/components/views/settings/encryption/KeyStoragePanel.tsx index 35073f00e91..8d71e927681 100644 --- a/apps/web/src/components/views/settings/encryption/KeyStoragePanel.tsx +++ b/apps/web/src/components/views/settings/encryption/KeyStoragePanel.tsx @@ -33,7 +33,7 @@ export const KeyStoragePanel: React.FC = ({ onKeyStorageDisableClick }) = const onKeyBackupChange = useCallback( (e: FormEvent) => { if (e.currentTarget.checked) { - setEnabled(true); + void setEnabled(true); } else { onKeyStorageDisableClick(); } diff --git a/apps/web/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx index b82dc4efcda..336c2651eb4 100644 --- a/apps/web/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx @@ -61,7 +61,7 @@ export default class AdvancedRoomSettingsTab extends React.Component { + void room.getRecommendedVersion().then((v) => { const tombstone = room.currentState.getStateEvents(EventType.RoomTombstone, ""); const additionalStateChanges: Partial = {}; diff --git a/apps/web/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx index b5105977665..94b3d74e3dd 100644 --- a/apps/web/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx @@ -127,7 +127,7 @@ export default class NotificationsSettingsTab extends React.Component { e.stopPropagation(); e.preventDefault(); - SettingsStore.setValue("notificationSound", this.props.roomId, SettingLevel.ROOM_ACCOUNT, null); + void SettingsStore.setValue("notificationSound", this.props.roomId, SettingLevel.ROOM_ACCOUNT, null); this.setState({ currentSound: "default", diff --git a/apps/web/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx index 4f598295169..5e41ee7e7db 100644 --- a/apps/web/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx @@ -387,7 +387,7 @@ export default class RolesRoomSettingsTab extends React.Component { + .map((key) => { const descriptor = powerLevelDescriptors[key]; if (isSpaceRoom && descriptor.hideForSpace) { return null; @@ -395,7 +395,7 @@ export default class RolesRoomSettingsTab extends React.Component +
    { dialog.close(); - this.createNewRoom(false, true); + void this.createNewRoom(false, true); }} > {" "} @@ -170,7 +170,7 @@ export default class SecurityRoomSettingsTab extends React.Component { + void finished.then(([confirm]) => { if (!confirm) { this.setState({ encrypted: false }); return; @@ -339,7 +339,7 @@ export default class SecurityRoomSettingsTab extends React.Component { dialog.close(); - this.createNewRoom(true, false); + void this.createNewRoom(true, false); }} > {" "} diff --git a/apps/web/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx index a5705694e97..e9b99fe39b8 100644 --- a/apps/web/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx @@ -66,7 +66,7 @@ const ElementCallSwitch: React.FC = ({ room }) => { newContent.events[ElementCallMemberEventType.name] = adminLevel; } - room.client.sendStateEvent(room.roomId, EventType.RoomPowerLevels, newContent); + void room.client.sendStateEvent(room.roomId, EventType.RoomPowerLevels, newContent); }, [room.client, room.roomId, content, isPublic], ); diff --git a/apps/web/src/components/views/settings/tabs/user/AccountUserSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/user/AccountUserSettingsTab.tsx index ccfb8160ab2..a572c98ec48 100644 --- a/apps/web/src/components/views/settings/tabs/user/AccountUserSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/user/AccountUserSettingsTab.tsx @@ -93,7 +93,7 @@ const AccountUserSettingsTab: React.FC = ({ closeSettingsFn }) => { const cli = sdkContext.client!; useEffect(() => { - (async () => { + void (async () => { const capabilities = (await cli.getCapabilities()) ?? {}; const changePasswordCap = capabilities["m.change_password"]; @@ -165,7 +165,7 @@ const AccountUserSettingsTab: React.FC = ({ closeSettingsFn }) => { const onDeactivateClicked = useCallback((): void => { const { finished } = Modal.createDialog(DeactivateAccountDialog); - finished.then(([success]) => { + void finished.then(([success]) => { if (success) closeSettingsFn(); }); }, [closeSettingsFn]); diff --git a/apps/web/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx index fe5fa52be08..9bf12ed1fd7 100644 --- a/apps/web/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx @@ -86,7 +86,7 @@ export default class AppearanceUserSettingsTab extends React.Component { const { finished } = Modal.createDialog(SetupEncryptionDialog); - finished.then(onFinish); + void finished.then(onFinish); }} > {_t("settings|encryption|device_not_verified_button")} diff --git a/apps/web/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx index f4f67e57d33..957e907a203 100644 --- a/apps/web/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx @@ -74,7 +74,7 @@ export default class HelpUserSettingsTab extends React.Component { + void this.context.store.deleteAllData().then(() => { PlatformPeg.get()?.reload(); }); }; diff --git a/apps/web/src/components/views/settings/tabs/user/MediaPreviewAccountSettings.tsx b/apps/web/src/components/views/settings/tabs/user/MediaPreviewAccountSettings.tsx index 1194f2fd020..9c51bf744ed 100644 --- a/apps/web/src/components/views/settings/tabs/user/MediaPreviewAccountSettings.tsx +++ b/apps/web/src/components/views/settings/tabs/user/MediaPreviewAccountSettings.tsx @@ -19,7 +19,7 @@ export const MediaPreviewAccountSettings: React.FC<{ roomId?: string }> = ({ roo const changeSetting = useCallback( (newValue: MediaPreviewConfig) => { - SettingsStore.setValue( + void SettingsStore.setValue( "mediaPreviewConfig", roomId ?? null, roomId ? SettingLevel.ROOM_ACCOUNT : SettingLevel.ACCOUNT, diff --git a/apps/web/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx index 2cf3dfb9ee1..e0c587f2f47 100644 --- a/apps/web/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx @@ -52,7 +52,7 @@ const LanguageSection: React.FC = () => { (newLanguage: string) => { if (language === newLanguage) return; - SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLanguage); + void SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLanguage); setLanguage(newLanguage); const platform = PlatformPeg.get(); if (platform) { @@ -79,7 +79,7 @@ const SpellCheckSection: React.FC = () => { const [spellCheckLanguages, setSpellCheckLanguages] = useState(); useEffect(() => { - (async () => { + void (async () => { const plaf = PlatformPeg.get(); const [enabled, langs] = await Promise.all([plaf?.getSpellCheckEnabled(), plaf?.getSpellCheckLanguages()]); @@ -185,7 +185,7 @@ export default class PreferencesUserSettingsTab extends React.Component { this.setState({ timezone: tz }); - TimezoneHandler.setUserTimezone(tz); + void TimezoneHandler.setUserTimezone(tz); }; /** @@ -204,17 +204,22 @@ export default class PreferencesUserSettingsTab extends React.Component): void => { this.setState({ autocompleteDelay: e.target.value }); - SettingsStore.setValue("autocompleteDelay", null, SettingLevel.DEVICE, e.target.valueAsNumber); + void SettingsStore.setValue("autocompleteDelay", null, SettingLevel.DEVICE, e.target.valueAsNumber); }; private onReadMarkerInViewThresholdMs = (e: React.ChangeEvent): void => { this.setState({ readMarkerInViewThresholdMs: e.target.value }); - SettingsStore.setValue("readMarkerInViewThresholdMs", null, SettingLevel.DEVICE, e.target.valueAsNumber); + void SettingsStore.setValue("readMarkerInViewThresholdMs", null, SettingLevel.DEVICE, e.target.valueAsNumber); }; private onReadMarkerOutOfViewThresholdMs = (e: React.ChangeEvent): void => { this.setState({ readMarkerOutOfViewThresholdMs: e.target.value }); - SettingsStore.setValue("readMarkerOutOfViewThresholdMs", null, SettingLevel.DEVICE, e.target.valueAsNumber); + void SettingsStore.setValue( + "readMarkerOutOfViewThresholdMs", + null, + SettingLevel.DEVICE, + e.target.valueAsNumber, + ); }; private renderGroup(settingIds: BooleanSettingKey[], level = SettingLevel.ACCOUNT): JSX.Element { diff --git a/apps/web/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx index f10f10e9ce3..174522522f9 100644 --- a/apps/web/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx @@ -160,7 +160,7 @@ export default class SecurityUserSettingsTab extends React.Component ({ waitingUnignored: [...waitingUnignored, userId] })); - MatrixClientPeg.safeGet().setIgnoredUsers(currentlyIgnoredUserIds); + await MatrixClientPeg.safeGet().setIgnoredUsers(currentlyIgnoredUserIds); } }; @@ -215,11 +215,11 @@ export default class SecurityUserSettingsTab extends React.Component { - this.manageInvites(true); + void this.manageInvites(true); }; private onRejectAllInvitesClicked = (): void => { - this.manageInvites(false); + void this.manageInvites(false); }; private renderIgnoredUsers(): JSX.Element { diff --git a/apps/web/src/components/views/settings/tabs/user/SessionManagerTab.tsx b/apps/web/src/components/views/settings/tabs/user/SessionManagerTab.tsx index 2e14aed20a1..ae675922dde 100644 --- a/apps/web/src/components/views/settings/tabs/user/SessionManagerTab.tsx +++ b/apps/web/src/components/views/settings/tabs/user/SessionManagerTab.tsx @@ -199,7 +199,7 @@ const SessionManagerTab: React.FC<{ const onVerifyCurrentDevice = (): void => { const { finished } = Modal.createDialog(SetupEncryptionDialog); - finished.then(refreshDevices); + void finished.then(refreshDevices); }; const onTriggerDeviceVerification = useCallback( @@ -212,9 +212,9 @@ const SessionManagerTab: React.FC<{ verificationRequestPromise, member: currentUserMember, }); - finished.then(async () => { + void finished.then(async () => { const request = await verificationRequestPromise; - request.cancel(); + await request.cancel(); await refreshDevices(); }); }, @@ -247,7 +247,7 @@ const SessionManagerTab: React.FC<{ const signOutAllOtherSessions = shouldShowOtherSessions && !disableMultipleSignout ? () => { - onSignOutOtherDevices(Object.keys(otherDevices)); + void onSignOutOtherDevices(Object.keys(otherDevices)); } : undefined; diff --git a/apps/web/src/components/views/spaces/SpaceCreateMenu.tsx b/apps/web/src/components/views/spaces/SpaceCreateMenu.tsx index 3fd76c49a07..9b73b1d6ff8 100644 --- a/apps/web/src/components/views/spaces/SpaceCreateMenu.tsx +++ b/apps/web/src/components/views/spaces/SpaceCreateMenu.tsx @@ -158,7 +158,7 @@ export const SpaceCreateForm: React.FC = ({ const newName = ev.target.value; if (!alias || alias === `#${nameToLocalpart(name)}:${domain}`) { setAlias(`#${nameToLocalpart(newName)}:${domain}`); - aliasFieldRef.current?.validate({ allowEmpty: true }); + void aliasFieldRef.current?.validate({ allowEmpty: true }); } setName(newName); }} @@ -216,7 +216,8 @@ const SpaceCreateMenu: React.FC<{ const [supportsSpaceFiltering, setSupportsSpaceFiltering] = useState(true); // assume it does until we find out it doesn't useEffect(() => { - cli.isVersionSupported("v1.4") + void cli + .isVersionSupported("v1.4") .then((supported) => { return supported || cli.doesServerSupportUnstableFeature("org.matrix.msc3827.stable"); }) @@ -233,7 +234,7 @@ const SpaceCreateMenu: React.FC<{ // require & validate the space name field if (spaceNameField.current && !(await spaceNameField.current.validate({ allowEmpty: false }))) { spaceNameField.current.focus(); - spaceNameField.current.validate({ allowEmpty: false, focused: true }); + void spaceNameField.current.validate({ allowEmpty: false, focused: true }); setBusy(false); return; } @@ -244,7 +245,7 @@ const SpaceCreateMenu: React.FC<{ !(await spaceAliasField.current.validate({ allowEmpty: false })) ) { spaceAliasField.current.focus(); - spaceAliasField.current.validate({ allowEmpty: false, focused: true }); + void spaceAliasField.current.validate({ allowEmpty: false, focused: true }); setBusy(false); return; } diff --git a/apps/web/src/components/views/spaces/SpacePanel.tsx b/apps/web/src/components/views/spaces/SpacePanel.tsx index 3232ed1b510..f631dba22f5 100644 --- a/apps/web/src/components/views/spaces/SpacePanel.tsx +++ b/apps/web/src/components/views/spaces/SpacePanel.tsx @@ -116,7 +116,12 @@ export const HomeButtonContextMenu: React.FC { onFinished(); - SettingsStore.setValue("Spaces.allRoomsInHome", null, SettingLevel.ACCOUNT, !allRoomsInHome); + void SettingsStore.setValue( + "Spaces.allRoomsInHome", + null, + SettingLevel.ACCOUNT, + !allRoomsInHome, + ); }} /> diff --git a/apps/web/src/components/views/toasts/VerificationRequestToast.tsx b/apps/web/src/components/views/toasts/VerificationRequestToast.tsx index 74db50d632e..87394200fd9 100644 --- a/apps/web/src/components/views/toasts/VerificationRequestToast.tsx +++ b/apps/web/src/components/views/toasts/VerificationRequestToast.tsx @@ -94,7 +94,7 @@ export default class VerificationRequestToast extends React.PureComponent { ToastStore.sharedInstance().dismissToast(this.props.toastKey); try { - this.props.request.cancel(); + void this.props.request.cancel(); } catch (err) { logger.error("Error while cancelling verification request", err); } @@ -133,7 +133,7 @@ export default class VerificationRequestToast extends React.PureComponent request.cancel()); + void finished.then(() => request.cancel()); } await request.accept(); } catch (err) { diff --git a/apps/web/src/components/views/verification/VerificationShowSas.tsx b/apps/web/src/components/views/verification/VerificationShowSas.tsx index 45e386510d7..cc890f72b0b 100644 --- a/apps/web/src/components/views/verification/VerificationShowSas.tsx +++ b/apps/web/src/components/views/verification/VerificationShowSas.tsx @@ -65,8 +65,13 @@ export default class VerificationShowSas extends React.Component ? _t("encryption|verification|confirm_the_emojis") : _t("encryption|verification|sas_emoji_caption_user"); } else if (this.props.sas.decimal) { - const numberBlocks = this.props.sas.decimal.map((num, i) => {num}); - sasDisplay =
    {numberBlocks}
    ; + sasDisplay = ( +
    + {this.props.sas.decimal[0]} + {this.props.sas.decimal[1]} + {this.props.sas.decimal[2]} +
    + ); sasCaption = this.props.isSelf ? _t("encryption|verification|sas_caption_self") : _t("encryption|verification|sas_caption_user"); diff --git a/apps/web/src/components/views/voip/AudioFeed.tsx b/apps/web/src/components/views/voip/AudioFeed.tsx index f8d28c54498..3053dceb07d 100644 --- a/apps/web/src/components/views/voip/AudioFeed.tsx +++ b/apps/web/src/components/views/voip/AudioFeed.tsx @@ -34,7 +34,7 @@ export default class AudioFeed extends React.Component { public componentDidMount(): void { MediaDeviceHandler.instance.addListener(MediaDeviceHandlerEvent.AudioOutputChanged, this.onAudioOutputChanged); this.props.feed.addListener(CallFeedEvent.NewStream, this.onNewStream); - this.playMedia(); + void this.playMedia(); } public componentWillUnmount(): void { @@ -54,7 +54,7 @@ export default class AudioFeed extends React.Component { // it fails. // It seems reliable if you set the sink ID after setting the srcObject and then set the sink ID // back to the default after the call is over - Dave - element!.setSinkId(audioOutput); + void element!.setSinkId(audioOutput); } catch (e) { logger.error("Couldn't set requested audio output device: using default", e); logger.warn("Couldn't set requested audio output device: using default", e); @@ -107,7 +107,7 @@ export default class AudioFeed extends React.Component { this.setState({ audioMuted: this.props.feed.isAudioMuted(), }); - this.playMedia(); + void this.playMedia(); }; public render(): React.ReactNode { diff --git a/apps/web/src/components/views/voip/AudioFeedArrayForLegacyCall.tsx b/apps/web/src/components/views/voip/AudioFeedArrayForLegacyCall.tsx index 062ea8693e5..b9cb5a24481 100644 --- a/apps/web/src/components/views/voip/AudioFeedArrayForLegacyCall.tsx +++ b/apps/web/src/components/views/voip/AudioFeedArrayForLegacyCall.tsx @@ -44,8 +44,8 @@ export default class AudioFeedArrayForLegacyCall extends React.Component { - return ; + return this.state.feeds.map((feed) => { + return ; }); } } diff --git a/apps/web/src/components/views/voip/CallView.tsx b/apps/web/src/components/views/voip/CallView.tsx index ac05b06c08c..08a458ed90d 100644 --- a/apps/web/src/components/views/voip/CallView.tsx +++ b/apps/web/src/components/views/voip/CallView.tsx @@ -31,7 +31,7 @@ const JoinCallView: FC = ({ room, resizing, call, role, onClo useEffect(() => { // We'll take this opportunity to tidy up our room state - call.clean(); + void call.clean(); }, [call]); const disconnectAllOtherCalls: () => Promise = useCallback(async () => { diff --git a/apps/web/src/components/views/voip/DialPadModal.tsx b/apps/web/src/components/views/voip/DialPadModal.tsx index 9b7cb1949fc..7ad4bbbbc91 100644 --- a/apps/web/src/components/views/voip/DialPadModal.tsx +++ b/apps/web/src/components/views/voip/DialPadModal.tsx @@ -43,7 +43,7 @@ export default class DialpadModal extends React.PureComponent { public onFormSubmit = (ev: SyntheticEvent): void => { ev.preventDefault(); - this.onDialPress(); + void this.onDialPress(); }; public onDigitPress = (digit: string, ev: ButtonEvent): void => { @@ -70,7 +70,7 @@ export default class DialpadModal extends React.PureComponent { }; public onDialPress = async (): Promise => { - SDKContextClass.instance.legacyCallHandler.dialNumber(this.state.value); + void SDKContextClass.instance.legacyCallHandler.dialNumber(this.state.value); this.props.onFinished(true); }; diff --git a/apps/web/src/components/views/voip/LegacyCallView.tsx b/apps/web/src/components/views/voip/LegacyCallView.tsx index 51c58fdd70e..eb38f84bc55 100644 --- a/apps/web/src/components/views/voip/LegacyCallView.tsx +++ b/apps/web/src/components/views/voip/LegacyCallView.tsx @@ -72,11 +72,11 @@ function getFullScreenElement(): Element | null { } function requestFullscreen(element: Element): void { - element.requestFullscreen(); + void element.requestFullscreen(); } function exitFullscreen(): void { - document.exitFullscreen(); + void document.exitFullscreen(); } export default class LegacyCallView extends React.Component { @@ -289,14 +289,14 @@ export default class LegacyCallView extends React.Component { const callAction = getKeyBindingsManager().getCallAction(ev); switch (callAction) { case KeyBindingAction.ToggleMicInCall: - this.onMicMuteClick(); + void this.onMicMuteClick(); // show the controls to give feedback this.buttonsRef.current?.showControls(); handled = true; break; case KeyBindingAction.ToggleWebcamInCall: - this.onVidMuteClick(); + void this.onVidMuteClick(); // show the controls to give feedback this.buttonsRef.current?.showControls(); handled = true; @@ -316,7 +316,7 @@ export default class LegacyCallView extends React.Component { private onTransferClick = (): void => { const transfereeCall = this.context.legacyCallHandler.getTransfereeForCallId(this.props.call.callId); - if (transfereeCall) this.props.call.transferToCall(transfereeCall); + if (transfereeCall) void this.props.call.transferToCall(transfereeCall); }; private onHangupClick = (): void => { diff --git a/apps/web/src/components/views/voip/VideoFeed.tsx b/apps/web/src/components/views/voip/VideoFeed.tsx index 9023491901b..6130381d25b 100644 --- a/apps/web/src/components/views/voip/VideoFeed.tsx +++ b/apps/web/src/components/views/voip/VideoFeed.tsx @@ -60,7 +60,7 @@ export default class VideoFeed extends React.PureComponent { public componentDidMount(): void { this.updateFeed(null, this.props.feed); - this.playMedia(); + void this.playMedia(); } public componentWillUnmount(): void { @@ -71,7 +71,7 @@ export default class VideoFeed extends React.PureComponent { this.updateFeed(prevProps.feed, this.props.feed); // If the mutes state has changed, we try to playMedia() if (prevState.videoMuted !== this.state.videoMuted || prevProps.feed.stream !== this.props.feed.stream) { - this.playMedia(); + void this.playMedia(); } } @@ -109,7 +109,7 @@ export default class VideoFeed extends React.PureComponent { if (this.props.feed.purpose === SDPStreamMetadataPurpose.Usermedia) { this.props.feed.measureVolumeActivity(true); } - this.playMedia(); + void this.playMedia(); } } @@ -158,7 +158,7 @@ export default class VideoFeed extends React.PureComponent { audioMuted: this.props.feed.isAudioMuted(), videoMuted: this.props.feed.isVideoMuted(), }); - this.playMedia(); + void this.playMedia(); }; private onMuteStateChanged = (): void => { diff --git a/apps/web/src/device-listener/DeviceListener.ts b/apps/web/src/device-listener/DeviceListener.ts index f4e3fa3e82b..76babb826c2 100644 --- a/apps/web/src/device-listener/DeviceListener.ts +++ b/apps/web/src/device-listener/DeviceListener.ts @@ -98,7 +98,7 @@ export class DeviceListener { ); this.dispatcherRef = dis.register(this.onAction); this.recheck(); - this.updateClientInformation(); + void this.updateClientInformation(); } public stop(): void { @@ -227,7 +227,7 @@ export class DeviceListener { private onAction = ({ action }: ActionPayload): void => { if (action !== Action.OnLoggedIn) return; this.recheck(); - this.updateClientInformation(); + void this.updateClientInformation(); }; public recheck(): void { @@ -353,7 +353,7 @@ export class DeviceListener { this.shouldRecordClientInformation = !!newValue; if (this.shouldRecordClientInformation !== prevValue) { - this.updateClientInformation(); + void this.updateClientInformation(); } }; diff --git a/apps/web/src/device-listener/DeviceListenerOtherDevices.ts b/apps/web/src/device-listener/DeviceListenerOtherDevices.ts index d39d77ef602..aee02be056e 100644 --- a/apps/web/src/device-listener/DeviceListenerOtherDevices.ts +++ b/apps/web/src/device-listener/DeviceListenerOtherDevices.ts @@ -187,7 +187,7 @@ export class DeviceListenerOtherDevices { // Show toasts for new unverified devices if they aren't already there for (const deviceId of newUnverifiedDeviceIds) { - showUnverifiedSessionToast(deviceId); + void showUnverifiedSessionToast(deviceId); } // ...and hide any we don't need any more diff --git a/apps/web/src/editor/operations.ts b/apps/web/src/editor/operations.ts index cde38ce44e1..91b6f1f67c7 100644 --- a/apps/web/src/editor/operations.ts +++ b/apps/web/src/editor/operations.ts @@ -59,7 +59,7 @@ export function formatRange(range: Range, action: Formatting): void { export function replaceRangeAndExpandSelection(range: Range, newParts: Part[]): void { const { model } = range; - model.transform(() => { + void model.transform(() => { const oldLen = range.length; const addedLen = range.replace(newParts); const firstOffset = range.start.asOffset(model); @@ -70,7 +70,7 @@ export function replaceRangeAndExpandSelection(range: Range, newParts: Part[]): export function replaceRangeAndMoveCaret(range: Range, newParts: Part[], offset = 0, atNodeEnd = false): void { const { model } = range; - model.transform(() => { + void model.transform(() => { const oldLen = range.length; const addedLen = range.replace(newParts); const firstOffset = range.start.asOffset(model); @@ -113,7 +113,7 @@ export function replaceRangeAndAutoAdjustCaret( } } // Calculate new position with respect to the previous position - model.transform(() => { + void model.transform(() => { const offsetDirection = Math.sign(range.replace(newParts)); // Compensates for shrinkage or expansion const atEnd = distanceFromEnd === suffixLength; return lastStartingPosition diff --git a/apps/web/src/emojipicker/recent.ts b/apps/web/src/emojipicker/recent.ts index 302b5b92af1..5d9ec88b454 100644 --- a/apps/web/src/emojipicker/recent.ts +++ b/apps/web/src/emojipicker/recent.ts @@ -73,7 +73,12 @@ export function add(emoji: string): void { newEntry = { emoji, total: 1 }; } - SettingsStore.setValue(SETTING_NAME, null, SettingLevel.ACCOUNT, [newEntry, ...recents].slice(0, STORAGE_LIMIT)); + void SettingsStore.setValue( + SETTING_NAME, + null, + SettingLevel.ACCOUNT, + [newEntry, ...recents].slice(0, STORAGE_LIMIT), + ); } export function get(limit = 24): string[] { diff --git a/apps/web/src/hooks/room/useRoomCall.tsx b/apps/web/src/hooks/room/useRoomCall.tsx index 4f8ae7890ce..198596a9155 100644 --- a/apps/web/src/hooks/room/useRoomCall.tsx +++ b/apps/web/src/hooks/room/useRoomCall.tsx @@ -268,7 +268,7 @@ export const useRoomCall = ( if (widget && promptPinWidget) { WidgetLayoutStore.instance.moveToContainer(room, widget, "top"); } else { - placeCall(room, CallType.Voice, callPlatformType, evt?.shiftKey || undefined, true); + void placeCall(room, CallType.Voice, callPlatformType, evt?.shiftKey || undefined, true); } }, [promptPinWidget, room, widget], @@ -281,7 +281,7 @@ export const useRoomCall = ( } else { // If we have pressed shift then always skip the lobby, otherwise `undefined` will defer // to the defaults of the call implementation. - placeCall(room, CallType.Video, callPlatformType, evt?.shiftKey || undefined, false); + void placeCall(room, CallType.Video, callPlatformType, evt?.shiftKey || undefined, false); } }, [widget, promptPinWidget, room], diff --git a/apps/web/src/hooks/spotlight/useRecentSearches.ts b/apps/web/src/hooks/spotlight/useRecentSearches.ts index 5adf6439533..204ce0c8387 100644 --- a/apps/web/src/hooks/spotlight/useRecentSearches.ts +++ b/apps/web/src/hooks/spotlight/useRecentSearches.ts @@ -24,7 +24,7 @@ export const useRecentSearches = (): [Room[], () => void] => { return [ rooms, () => { - SettingsStore.setValue("SpotlightSearch.recentSearches", null, SettingLevel.ACCOUNT, []); + void SettingsStore.setValue("SpotlightSearch.recentSearches", null, SettingLevel.ACCOUNT, []); setRooms([]); }, ]; diff --git a/apps/web/src/hooks/useAsyncMemo.ts b/apps/web/src/hooks/useAsyncMemo.ts index d5d99065651..6b3c113f530 100644 --- a/apps/web/src/hooks/useAsyncMemo.ts +++ b/apps/web/src/hooks/useAsyncMemo.ts @@ -16,7 +16,7 @@ export function useAsyncMemo(fn: Fn, deps: DependencyList, initialValue?: const [value, setValue] = useState(initialValue); useEffect(() => { let discard = false; - fn().then((v) => { + void fn().then((v) => { if (!discard) { setValue(v); } diff --git a/apps/web/src/hooks/useEncryptionStatus.ts b/apps/web/src/hooks/useEncryptionStatus.ts index 75c894c8031..7e8d71a412b 100644 --- a/apps/web/src/hooks/useEncryptionStatus.ts +++ b/apps/web/src/hooks/useEncryptionStatus.ts @@ -22,7 +22,7 @@ export function useEncryptionStatus(client: MatrixClient, room: Room): E2EStatus throttle( () => { if (client.getCrypto()) { - shieldStatusForRoom(client, room).then((e2eStatus) => { + void shieldStatusForRoom(client, room).then((e2eStatus) => { setE2eStatus(e2eStatus); }); } diff --git a/apps/web/src/hooks/useEventEmitter.ts b/apps/web/src/hooks/useEventEmitter.ts index fc218ce6545..2babad8f79f 100644 --- a/apps/web/src/hooks/useEventEmitter.ts +++ b/apps/web/src/hooks/useEventEmitter.ts @@ -164,7 +164,7 @@ export function useEventEmitterAsyncState { if (!(v instanceof NoChange)) { setValue(v); diff --git a/apps/web/src/hooks/usePermalinkEvent.ts b/apps/web/src/hooks/usePermalinkEvent.ts index 85adc20dc9c..d1ea81036f3 100644 --- a/apps/web/src/hooks/usePermalinkEvent.ts +++ b/apps/web/src/hooks/usePermalinkEvent.ts @@ -74,7 +74,7 @@ export const usePermalinkEvent = ( } catch {} }; - fetchRoomEvent(); + void fetchRoomEvent(); }, [event, eventId, parseResult?.eventId, parseResult?.roomIdOrAlias, shouldLookUpEvent]); return event; diff --git a/apps/web/src/hooks/usePermalinkMember.ts b/apps/web/src/hooks/usePermalinkMember.ts index 8ca5d76e754..71293735e58 100644 --- a/apps/web/src/hooks/usePermalinkMember.ts +++ b/apps/web/src/hooks/usePermalinkMember.ts @@ -121,7 +121,7 @@ export const usePermalinkMember = ( } }; - doProfileLookup(); + void doProfileLookup(); }, [context, member, shouldLookUpUser, targetRoom, userId]); return member; diff --git a/apps/web/src/hooks/usePublicRoomDirectory.ts b/apps/web/src/hooks/usePublicRoomDirectory.ts index dd6cd3382d3..086228046e0 100644 --- a/apps/web/src/hooks/usePublicRoomDirectory.ts +++ b/apps/web/src/hooks/usePublicRoomDirectory.ts @@ -128,7 +128,7 @@ export const usePublicRoomDirectory = (): { ); useEffect(() => { - initProtocols(); + void initProtocols(); }, []); useEffect(() => { diff --git a/apps/web/src/hooks/useSpaceResults.ts b/apps/web/src/hooks/useSpaceResults.ts index c6844cc86b1..d6a2cc8be93 100644 --- a/apps/web/src/hooks/useSpaceResults.ts +++ b/apps/web/src/hooks/useSpaceResults.ts @@ -28,11 +28,11 @@ export const useSpaceResults = (space: Room | undefined, query: string): [Hierar let unmounted = false; - (async (): Promise => { + void (async (): Promise => { // oxlint-disable-next-line no-unmodified-loop-condition while (hierarchy?.canLoadMore && !unmounted && space === hierarchy.root) { await hierarchy.load(); - if (hierarchy.canLoadMore) hierarchy.load(); // start next load so that the loading attribute is right + if (hierarchy.canLoadMore) void hierarchy.load(); // start next load so that the loading attribute is right setRooms(hierarchy.rooms!); } })(); diff --git a/apps/web/src/hooks/useUserStatus.ts b/apps/web/src/hooks/useUserStatus.ts index 131e43f9aec..f4edecdc575 100644 --- a/apps/web/src/hooks/useUserStatus.ts +++ b/apps/web/src/hooks/useUserStatus.ts @@ -37,7 +37,7 @@ export function useUserStatus(userId: string | undefined): UserStatus | undefine setRawUserStatus(syncProfile["org.matrix.msc4426.status"]); }); useEffect(() => { - (async () => { + void (async () => { if (!isEnabled) { return; } diff --git a/apps/web/src/hooks/useUserTimezone.ts b/apps/web/src/hooks/useUserTimezone.ts index 04de7c60e1a..d648583964b 100644 --- a/apps/web/src/hooks/useUserTimezone.ts +++ b/apps/web/src/hooks/useUserTimezone.ts @@ -59,7 +59,7 @@ export const useUserTimezone = (cli: MatrixClient, userId: string): { timezone: if (supported !== true) { return; } - (async () => { + void (async () => { log.debug("Trying to fetch TZ for", userId); try { const userProfile = await cli.getExtendedProfile(userId); diff --git a/apps/web/src/indexing/EventIndex.ts b/apps/web/src/indexing/EventIndex.ts index 0b7f5d5fda9..c131968effb 100644 --- a/apps/web/src/indexing/EventIndex.ts +++ b/apps/web/src/indexing/EventIndex.ts @@ -261,7 +261,7 @@ export default class EventIndex extends EventEmitter { if (ev.getType() === EventType.RoomEncryption && !(await this.isRoomIndexed(state.roomId))) { this.logger.debug("Adding a checkpoint for a newly encrypted room", state.roomId); - this.addRoomCheckpoint(state.roomId, true); + void this.addRoomCheckpoint(state.roomId, true); } }; @@ -295,7 +295,7 @@ export default class EventIndex extends EventEmitter { this.logger.debug("Adding a checkpoint because of a limited timeline", room.roomId); - this.addRoomCheckpoint(room.roomId, false); + void this.addRoomCheckpoint(room.roomId, false); }; /** diff --git a/apps/web/src/modules/ProxiedModuleApi.ts b/apps/web/src/modules/ProxiedModuleApi.ts index 84a8fa0d3cf..2b8d5962df6 100644 --- a/apps/web/src/modules/ProxiedModuleApi.ts +++ b/apps/web/src/modules/ProxiedModuleApi.ts @@ -86,7 +86,7 @@ export class ProxiedModuleApi implements ModuleApi { typeof initialTitleOrOptions === "string" ? { title: initialTitleOrOptions } : initialTitleOrOptions; return new Promise<{ didOkOrSubmit: boolean; model: M }>((resolve) => { - Modal.createDialog( + void Modal.createDialog( ModuleUiDialog, { initialOptions, diff --git a/apps/web/src/rageshake/rageshake.ts b/apps/web/src/rageshake/rageshake.ts index 0ce19664785..e190d2a6318 100644 --- a/apps/web/src/rageshake/rageshake.ts +++ b/apps/web/src/rageshake/rageshake.ts @@ -533,7 +533,7 @@ export function tryInitStorage(): Promise { global.mx_rage_initStoragePromise = global.mx_rage_store.connect(); // Fire off a task in the background which will clean up old logs in the store - global.mx_rage_initStoragePromise.then(() => { + void global.mx_rage_initStoragePromise.then(() => { global.mx_rage_store.consume().catch((e) => { logger.error("Error cleaning up rageshake store", e); }); @@ -549,7 +549,7 @@ export function flush(): void { if (!global.mx_rage_store) { return; } - global.mx_rage_store.flush(); + void global.mx_rage_store.flush(); } /** diff --git a/apps/web/src/sendTimePerformanceMetrics.ts b/apps/web/src/sendTimePerformanceMetrics.ts index 45298b2cd29..a78ef788607 100644 --- a/apps/web/src/sendTimePerformanceMetrics.ts +++ b/apps/web/src/sendTimePerformanceMetrics.ts @@ -28,7 +28,7 @@ export function decorateStartSendingTime(content: IContent): void { */ export function sendRoundTripMetric(client: MatrixClient, inRoomId: string, forEventId: string): void { // noinspection JSIgnoredPromiseFromCall - client.sendEvent(inRoomId, "io.element.performance_metric", { + void client.sendEvent(inRoomId, "io.element.performance_metric", { "io.element.performance_metrics": { forEventId: forEventId, responseTs: Date.now(), diff --git a/apps/web/src/settings/SettingsStore.ts b/apps/web/src/settings/SettingsStore.ts index b0342692da5..ca999d40cb6 100644 --- a/apps/web/src/settings/SettingsStore.ts +++ b/apps/web/src/settings/SettingsStore.ts @@ -231,7 +231,7 @@ export default class SettingsStore { * @param {string} settingName The setting name to monitor. * @param {String} roomId The room ID to monitor for changes in. Use null for all rooms. */ - public static monitorSetting(settingName: S, roomId: string | null): void { + public static monitorSetting(settingName: SettingKey, roomId: string | null): void { roomId = roomId || null; // the thing wants null specifically to work, so appease it. if (!this.monitors.has(settingName)) this.monitors.set(settingName, new Map()); @@ -239,7 +239,7 @@ export default class SettingsStore { const registerWatcher = (): void => { this.monitors.get(settingName)!.set( roomId, - SettingsStore.watchSetting( + SettingsStore.watchSetting( settingName, roomId, (settingName, inRoomId, level, newValueAtLevel, newValue) => { @@ -674,7 +674,7 @@ export default class SettingsStore { .filter((k) => k.startsWith("mx_ShowImage_")) .map((k) => [k.slice("mx_ShowImage_".length), true]), ); - this.setValue("showMediaEventIds", null, SettingLevel.DEVICE, newValue); + void this.setValue("showMediaEventIds", null, SettingLevel.DEVICE, newValue); localStorage.setItem(MIGRATION_DONE_FLAG, "true"); } @@ -701,7 +701,7 @@ export default class SettingsStore { const showAvatarsOnInvites = handler.getValue("showAvatarsOnInvites", null); if (typeof showImages === "boolean" || typeof showAvatarsOnInvites === "boolean") { - this.setValue("mediaPreviewConfig", null, SettingLevel.ACCOUNT, { + void this.setValue("mediaPreviewConfig", null, SettingLevel.ACCOUNT, { invite_avatars: showAvatarsOnInvites === false ? MediaPreviewValue.Off : MediaPreviewValue.On, media_previews: showImages === false ? MediaPreviewValue.Off : MediaPreviewValue.On, }); diff --git a/apps/web/src/settings/controllers/InviteRulesConfigController.ts b/apps/web/src/settings/controllers/InviteRulesConfigController.ts index 61c73230093..b0361abb42e 100644 --- a/apps/web/src/settings/controllers/InviteRulesConfigController.ts +++ b/apps/web/src/settings/controllers/InviteRulesConfigController.ts @@ -33,7 +33,7 @@ export default class InviteRulesConfigController extends MatrixClientBackedContr } public initMatrixClient(newClient: MatrixClient): void { - newClient.doesServerSupportUnstableFeature("org.matrix.msc4155").then((result) => { + void newClient.doesServerSupportUnstableFeature("org.matrix.msc4155").then((result) => { this.featureSupported = result; }); } diff --git a/apps/web/src/settings/handlers/AccountSettingsHandler.ts b/apps/web/src/settings/handlers/AccountSettingsHandler.ts index 9ea7a43c570..59ebedb20d7 100644 --- a/apps/web/src/settings/handlers/AccountSettingsHandler.ts +++ b/apps/web/src/settings/handlers/AccountSettingsHandler.ts @@ -128,7 +128,7 @@ export default class AccountSettingsHandler extends MatrixClientBackedSettingsHa // Write true as it is the default. This will give us the option // of making this opt-in in the future, without affecting old // users - this.setValue(settingName, roomId, true); + void this.setValue(settingName, roomId, true); return true; } return value; diff --git a/apps/web/src/settings/handlers/PlatformSettingsHandler.ts b/apps/web/src/settings/handlers/PlatformSettingsHandler.ts index 4741f355304..8f0ec76719f 100644 --- a/apps/web/src/settings/handlers/PlatformSettingsHandler.ts +++ b/apps/web/src/settings/handlers/PlatformSettingsHandler.ts @@ -31,7 +31,7 @@ export default class PlatformSettingsHandler extends SettingsHandler { // Load setting values as they are async and `getValue` must be synchronous Object.entries(SETTINGS).forEach(([key, setting]) => { if (setting.supportedLevels?.includes(SettingLevel.PLATFORM) && platform.supportsSetting(key)) { - platform.getSettingValue(key).then((value: any) => { + void platform.getSettingValue(key).then((value: any) => { this.store[key] = value; }); } diff --git a/apps/web/src/settings/watchers/FontWatcher.ts b/apps/web/src/settings/watchers/FontWatcher.ts index 9a36d8f73e5..c552687bb20 100644 --- a/apps/web/src/settings/watchers/FontWatcher.ts +++ b/apps/web/src/settings/watchers/FontWatcher.ts @@ -148,7 +148,7 @@ export class FontWatcher implements IWatcher { } private updateFont(): void { - this.setRootFontSize(SettingsStore.getValue("fontSizeDelta")); + void this.setRootFontSize(SettingsStore.getValue("fontSizeDelta")); this.setSystemFont({ useBundledEmojiFont: SettingsStore.getValue("useBundledEmojiFont"), useSystemFont: SettingsStore.getValue("useSystemFont"), @@ -158,14 +158,14 @@ export class FontWatcher implements IWatcher { private onAction = (payload: ActionPayload): void => { if (payload.action === Action.MigrateBaseFontSize) { - this.migrateBaseFontSize(); + void this.migrateBaseFontSize(); } else if (payload.action === Action.UpdateFontSizeDelta) { - this.setRootFontSize(payload.delta); + void this.setRootFontSize(payload.delta); } else if (payload.action === Action.UpdateSystemFont) { this.setSystemFont(payload as UpdateSystemFontPayload); } else if (payload.action === Action.OnLoggedOut) { // Clear font overrides when logging out - this.setRootFontSize(FontWatcher.DEFAULT_DELTA); + void this.setRootFontSize(FontWatcher.DEFAULT_DELTA); this.setSystemFont({ useBundledEmojiFont: false, useSystemFont: false, diff --git a/apps/web/src/slash-commands/SlashCommands.tsx b/apps/web/src/slash-commands/SlashCommands.tsx index ae56c9e316f..a8e1ae9b6ff 100644 --- a/apps/web/src/slash-commands/SlashCommands.tsx +++ b/apps/web/src/slash-commands/SlashCommands.tsx @@ -608,7 +608,7 @@ export const Commands = [ return success( finished.then(([confirmed]) => { - if (confirmed) manuallyVerifyDevice(cli, deviceId, fingerprint); + if (confirmed) void manuallyVerifyDevice(cli, deviceId, fingerprint); }), ); } @@ -624,7 +624,7 @@ export const Commands = [ isEnabled: (cli) => !isCurrentLocalRoom(cli), runFn: function (cli, roomId) { try { - cli.getCrypto()?.forceDiscardSession(roomId); + void cli.getCrypto()?.forceDiscardSession(roomId); } catch (e) { return reject(e instanceof Error ? e.message : e); } @@ -755,7 +755,7 @@ export const Commands = [ metricsViaKeyboard: true, }); if (msg) { - cli.sendTextMessage(roomId, msg); + void cli.sendTextMessage(roomId, msg); } })(), ); diff --git a/apps/web/src/slash-commands/utils.ts b/apps/web/src/slash-commands/utils.ts index 40ec7c2744e..12c9f79dbd3 100644 --- a/apps/web/src/slash-commands/utils.ts +++ b/apps/web/src/slash-commands/utils.ts @@ -55,7 +55,7 @@ export const singleMxcUpload = async (cli: MatrixClient): Promise if (!file) return; const { finished } = Modal.createDialog(UploadConfirmDialog, { file }); - finished.then(async ([shouldContinue]) => { + void finished.then(async ([shouldContinue]) => { if (shouldContinue) { const { content_uri: uri } = await cli.uploadContent(file); resolve(uri); diff --git a/apps/web/src/stores/BreadcrumbsStore.ts b/apps/web/src/stores/BreadcrumbsStore.ts index e1df06076be..3e9a56a82f0 100644 --- a/apps/web/src/stores/BreadcrumbsStore.ts +++ b/apps/web/src/stores/BreadcrumbsStore.ts @@ -29,7 +29,7 @@ interface IState { export class BreadcrumbsStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new BreadcrumbsStore(); - instance.start(); + void instance.start(); return instance; })(); diff --git a/apps/web/src/stores/CallStore.ts b/apps/web/src/stores/CallStore.ts index 119a0f6d6e8..b8aa630c44a 100644 --- a/apps/web/src/stores/CallStore.ts +++ b/apps/web/src/stores/CallStore.ts @@ -32,7 +32,7 @@ export class CallStore extends AsyncStoreWithClient { public static get instance(): CallStore { if (!this._instance) { this._instance = new CallStore(); - this._instance.start(); + void this._instance.start(); } return this._instance; } @@ -136,7 +136,7 @@ export class CallStore extends AsyncStoreWithClient { this.emit(CallStoreEvent.ConnectedCalls, value); // The room IDs are persisted to settings so we can detect unclean disconnects - SettingsStore.setValue( + void SettingsStore.setValue( "activeCallRoomIds", null, SettingLevel.DEVICE, diff --git a/apps/web/src/stores/LifecycleStore.ts b/apps/web/src/stores/LifecycleStore.ts index 52334a71cec..734c5a8cf74 100644 --- a/apps/web/src/stores/LifecycleStore.ts +++ b/apps/web/src/stores/LifecycleStore.ts @@ -42,12 +42,12 @@ class LifecycleStore extends AsyncStore { protected onDispatch(payload: ActionPayload | DoAfterSyncPreparedPayload): void { switch (payload.action) { case Action.DoAfterSyncPrepared: - this.updateState({ + void this.updateState({ deferredAction: payload.deferred_action, }); break; case "cancel_after_sync_prepared": - this.updateState({ + void this.updateState({ deferredAction: null, }); break; @@ -55,7 +55,7 @@ class LifecycleStore extends AsyncStore { if (payload.state === SyncState.Syncing && payload.prevState !== SyncState.Syncing) { // We've reconnected to the server: update server version support // This is async but we don't care about the result, so just fire & forget. - checkServerVersions(); + void checkServerVersions(); } if (payload.state !== "PREPARED") { @@ -63,7 +63,7 @@ class LifecycleStore extends AsyncStore { } if (!this.state.deferredAction) break; const deferredAction = Object.assign({}, this.state.deferredAction); - this.updateState({ + void this.updateState({ deferredAction: null, }); dis.dispatch(deferredAction); @@ -71,7 +71,7 @@ class LifecycleStore extends AsyncStore { } case Action.ClientNotViable: case Action.OnLoggedOut: - this.reset(); + void this.reset(); break; } } diff --git a/apps/web/src/stores/ModalWidgetStore.ts b/apps/web/src/stores/ModalWidgetStore.ts index a1c5a5aa062..90bc20714f8 100644 --- a/apps/web/src/stores/ModalWidgetStore.ts +++ b/apps/web/src/stores/ModalWidgetStore.ts @@ -24,7 +24,7 @@ interface IState { export class ModalWidgetStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new ModalWidgetStore(); - instance.start(); + void instance.start(); return instance; })(); private modalInstance: IHandle | null = null; @@ -66,7 +66,7 @@ export class ModalWidgetStore extends AsyncStoreWithClient { /* priority = */ false, /* static = */ true, ); - this.modalInstance.finished.then(([success, data]) => { + void this.modalInstance.finished.then(([success, data]) => { this.closeModalWidget(sourceWidget, widgetRoomId, success && data ? data : { "m.exited": true }); this.openSourceWidgetId = null; @@ -92,7 +92,7 @@ export class ModalWidgetStore extends AsyncStoreWithClient { logger.error("No source widget API for modal widget"); return; } - sourceMessaging.widgetApi.notifyModalWidgetClose(data); + void sourceMessaging.widgetApi.notifyModalWidgetClose(data); } }; } diff --git a/apps/web/src/stores/MultiRoomViewStore.ts b/apps/web/src/stores/MultiRoomViewStore.ts index 201458933bf..cfe94896051 100644 --- a/apps/web/src/stores/MultiRoomViewStore.ts +++ b/apps/web/src/stores/MultiRoomViewStore.ts @@ -37,7 +37,7 @@ export class MultiRoomViewStore { : new RoomViewStore(this.dispatcher, this.sdkContextClass, roomId); // RoomView component does not render the room unless you call viewRoom - store.viewRoom({ + void store.viewRoom({ action: Action.ViewRoom, room_id: roomId, metricsTrigger: undefined, diff --git a/apps/web/src/stores/OwnBeaconStore.ts b/apps/web/src/stores/OwnBeaconStore.ts index b8d2a08ecc9..13251702564 100644 --- a/apps/web/src/stores/OwnBeaconStore.ts +++ b/apps/web/src/stores/OwnBeaconStore.ts @@ -87,7 +87,7 @@ const getLocallyCreatedBeaconEventIds = (): string[] => { export class OwnBeaconStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new OwnBeaconStore(); - instance.start(); + void instance.start(); return instance; })(); // users beacons, keyed by event type @@ -208,7 +208,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient { // instead of just one that was changed // to keep lastPublishedTimestamp simple // and extra published locations don't hurt - this.publishCurrentLocationToBeacons(); + void this.publishCurrentLocationToBeacons(); }; public getLiveBeaconIds = (roomId?: string): string[] => { @@ -280,7 +280,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient { // beacon expired, update beacon to un-alive state if (!isLive) { - this.stopBeacon(beacon.identifier); + void this.stopBeacon(beacon.identifier); } this.checkLiveness(); @@ -406,7 +406,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient { // it will be created below by togglePollingLocation // and publish first position quickly if (diff.added.length && this.isMonitoringLiveLocation) { - this.publishCurrentLocationToBeacons(); + void this.publishCurrentLocationToBeacons(); } // if overall liveness changed @@ -442,7 +442,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient { private togglePollingLocation = (): void => { if (!!this.liveBeaconIds.length) { - this.startPollingLocation(); + void this.startPollingLocation(); } else { this.stopPollingLocation(); } @@ -456,7 +456,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient { this.clearPositionWatch = watchPosition(this.onWatchedPosition, this.onGeolocationError); } catch (error) { if (error instanceof Error) { - this.onGeolocationError(error.message as GeolocationError); + void this.onGeolocationError(error.message as GeolocationError); } else { console.error("Unexpected error", error); } @@ -471,7 +471,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient { // if position was last updated STATIC_UPDATE_INTERVAL ms ago or more // get our position and publish it if (this.lastPublishedPositionTimestamp <= Date.now() - STATIC_UPDATE_INTERVAL) { - this.publishCurrentLocationToBeacons(); + void this.publishCurrentLocationToBeacons(); } }, STATIC_UPDATE_INTERVAL); @@ -496,9 +496,9 @@ export class OwnBeaconStore extends AsyncStoreWithClient { // if this is our first position, publish immediately if (!this.lastPublishedPositionTimestamp) { - this.publishLocationToBeacons(timedGeoPosition); + void this.publishLocationToBeacons(timedGeoPosition); } else { - this.debouncedPublishLocationToBeacons(timedGeoPosition); + void this.debouncedPublishLocationToBeacons(timedGeoPosition); } }; @@ -525,10 +525,10 @@ export class OwnBeaconStore extends AsyncStoreWithClient { private publishCurrentLocationToBeacons = async (): Promise => { try { const position = await getCurrentPosition(); - this.publishLocationToBeacons(mapGeolocationPositionToTimedGeo(position)); + void this.publishLocationToBeacons(mapGeolocationPositionToTimedGeo(position)); } catch (error) { if (error instanceof Error) { - this.onGeolocationError(error.message as GeolocationError); + void this.onGeolocationError(error.message as GeolocationError); } else { console.error("Unexpected error", error); } diff --git a/apps/web/src/stores/OwnProfileStore.ts b/apps/web/src/stores/OwnProfileStore.ts index a1a2d8ebe62..9bfab317768 100644 --- a/apps/web/src/stores/OwnProfileStore.ts +++ b/apps/web/src/stores/OwnProfileStore.ts @@ -40,7 +40,7 @@ const KEY_AVATAR_URL = "mx_profile_avatar_url"; export class OwnProfileStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new OwnProfileStore(); - instance.start(); + void instance.start(); return instance; })(); diff --git a/apps/web/src/stores/RoomViewStore.tsx b/apps/web/src/stores/RoomViewStore.tsx index 9dadd8a34d2..33f4ba6b392 100644 --- a/apps/web/src/stores/RoomViewStore.tsx +++ b/apps/web/src/stores/RoomViewStore.tsx @@ -218,7 +218,7 @@ export class RoomViewStore extends EventEmitter { // - event_offset: 100 // - highlighted: true case Action.ViewRoom: - this.viewRoom(payload as ViewRoomPayload); + void this.viewRoom(payload as ViewRoomPayload); break; case Action.ViewThread: this.viewThread(payload as ThreadPayload); @@ -250,7 +250,7 @@ export class RoomViewStore extends EventEmitter { // join_room: // - opts: options for joinRoom case Action.JoinRoom: - this.joinRoom(payload as JoinRoomPayload); + void this.joinRoom(payload as JoinRoomPayload); break; case Action.JoinRoomError: this.joinRoomError(payload as JoinRoomErrorPayload); @@ -260,7 +260,7 @@ export class RoomViewStore extends EventEmitter { this.setState({ shouldPeek: false }); } - awaitRoomDownSync(MatrixClientPeg.safeGet(), payload.roomId).then((room) => { + void awaitRoomDownSync(MatrixClientPeg.safeGet(), payload.roomId).then((room) => { const numMembers = room.getJoinedMemberCount(); const roomSize = numMembers > 1000 @@ -388,7 +388,7 @@ export class RoomViewStore extends EventEmitter { // Immediately start the call. This will connect to all required widget events // and allow the widget to show the lobby. if (call.connectionState === ConnectionState.Disconnected) { - call.start({ skipLobby: payload.skipLobby, voiceOnly: payload.voiceOnly }); + void call.start({ skipLobby: payload.skipLobby, voiceOnly: payload.voiceOnly }); } } // If we switch to a different room from the call, we are no longer presenting it diff --git a/apps/web/src/stores/SetupEncryptionStore.ts b/apps/web/src/stores/SetupEncryptionStore.ts index 659a524edd1..b63afd05e3c 100644 --- a/apps/web/src/stores/SetupEncryptionStore.ts +++ b/apps/web/src/stores/SetupEncryptionStore.ts @@ -68,10 +68,10 @@ export class SetupEncryptionStore extends EventEmitter { // If there are multiple, we take the most recent. Equally if the user sends another request from // another device after this screen has been shown, we'll switch to the new one, so this // generally doesn't support multiple requests. - this.setActiveVerificationRequest(requestsInProgress[requestsInProgress.length - 1]); + void this.setActiveVerificationRequest(requestsInProgress[requestsInProgress.length - 1]); } - this.fetchKeyInfo(); + void this.fetchKeyInfo(); } public stop(): void { @@ -173,7 +173,7 @@ export class SetupEncryptionStore extends EventEmitter { }; public onVerificationRequest = (request: VerificationRequest): void => { - this.setActiveVerificationRequest(request); + void this.setActiveVerificationRequest(request); }; public onVerificationRequestChange = async (): Promise => { diff --git a/apps/web/src/stores/TypingStore.ts b/apps/web/src/stores/TypingStore.ts index 2796cc22932..0d7986a102c 100644 --- a/apps/web/src/stores/TypingStore.ts +++ b/apps/web/src/stores/TypingStore.ts @@ -77,7 +77,7 @@ export default class TypingStore { if (isTyping) { if (!currentTyping.serverTimer.isRunning()) { - currentTyping.serverTimer + void currentTyping.serverTimer .restart() .finished() .then(() => { @@ -90,7 +90,7 @@ export default class TypingStore { } else currentTyping.serverTimer.restart(); if (!currentTyping.userTimer.isRunning()) { - currentTyping.userTimer + void currentTyping.userTimer .restart() .finished() .then(() => { @@ -99,6 +99,6 @@ export default class TypingStore { } else currentTyping.userTimer.restart(); } - this.context.client?.sendTyping(roomId, isTyping, TYPING_SERVER_TIMEOUT); + void this.context.client?.sendTyping(roomId, isTyping, TYPING_SERVER_TIMEOUT); } } diff --git a/apps/web/src/stores/VoiceRecordingStore.ts b/apps/web/src/stores/VoiceRecordingStore.ts index 20ad0924843..fcc375fbc26 100644 --- a/apps/web/src/stores/VoiceRecordingStore.ts +++ b/apps/web/src/stores/VoiceRecordingStore.ts @@ -29,7 +29,7 @@ export class VoiceRecordingStore extends AsyncStoreWithClient { public static get instance(): VoiceRecordingStore { if (!this.internalInstance) { this.internalInstance = new VoiceRecordingStore(); - this.internalInstance.start(); + void this.internalInstance.start(); } return this.internalInstance; } @@ -71,7 +71,7 @@ export class VoiceRecordingStore extends AsyncStoreWithClient { const recording = createVoiceMessageRecording(this.matrixClient); // noinspection JSIgnoredPromiseFromCall - we can safely run this async - this.updateState({ ...this.state, [voiceRecordingId]: recording }); + void this.updateState({ ...this.state, [voiceRecordingId]: recording }); return recording; } diff --git a/apps/web/src/stores/WidgetStore.ts b/apps/web/src/stores/WidgetStore.ts index fbae950dbc7..c9745d3d30b 100644 --- a/apps/web/src/stores/WidgetStore.ts +++ b/apps/web/src/stores/WidgetStore.ts @@ -37,7 +37,7 @@ interface IRoomWidgets { export default class WidgetStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new WidgetStore(); - instance.start(); + void instance.start(); return instance; })(); diff --git a/apps/web/src/stores/local-echo/EchoStore.ts b/apps/web/src/stores/local-echo/EchoStore.ts index 90a52f6cac1..ba854e03248 100644 --- a/apps/web/src/stores/local-echo/EchoStore.ts +++ b/apps/web/src/stores/local-echo/EchoStore.ts @@ -38,7 +38,7 @@ export class EchoStore extends AsyncStoreWithClient { public static get instance(): EchoStore { if (!this._instance) { this._instance = new EchoStore(); - this._instance.start(); + void this._instance.start(); } return this._instance; } diff --git a/apps/web/src/stores/message-preview/MessagePreviewStore.ts b/apps/web/src/stores/message-preview/MessagePreviewStore.ts index fdf59dafde3..5c67d4f6fb5 100644 --- a/apps/web/src/stores/message-preview/MessagePreviewStore.ts +++ b/apps/web/src/stores/message-preview/MessagePreviewStore.ts @@ -82,7 +82,7 @@ const mkMessagePreview = (text: string, event: MatrixEvent): MessagePreview => { export class MessagePreviewStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new MessagePreviewStore(); - instance.start(); + void instance.start(); return instance; })(); diff --git a/apps/web/src/stores/notifications/RoomNotificationStateStore.ts b/apps/web/src/stores/notifications/RoomNotificationStateStore.ts index 2ab82cf8ba2..a9697d7c8e0 100644 --- a/apps/web/src/stores/notifications/RoomNotificationStateStore.ts +++ b/apps/web/src/stores/notifications/RoomNotificationStateStore.ts @@ -24,7 +24,7 @@ export const UPDATE_STATUS_INDICATOR = Symbol("update-status-indicator"); export class RoomNotificationStateStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new RoomNotificationStateStore(); - instance.start(); + void instance.start(); return instance; })(); private roomMap = new Map(); diff --git a/apps/web/src/stores/right-panel/RightPanelStore.ts b/apps/web/src/stores/right-panel/RightPanelStore.ts index f5ebded47d1..14e69ae00a1 100644 --- a/apps/web/src/stores/right-panel/RightPanelStore.ts +++ b/apps/web/src/stores/right-panel/RightPanelStore.ts @@ -315,13 +315,13 @@ export default class RightPanelStore extends ReadyWatchingStore { private emitAndUpdateSettings(): void { this.filterValidCards(this.global); const storePanelGlobal = convertToStorePanel(this.global); - SettingsStore.setValue("RightPanel.phasesGlobal", null, SettingLevel.DEVICE, storePanelGlobal); + void SettingsStore.setValue("RightPanel.phasesGlobal", null, SettingLevel.DEVICE, storePanelGlobal); if (!!this.viewedRoomId) { const panelThisRoom = this.byRoom[this.viewedRoomId]; this.filterValidCards(panelThisRoom); const storePanelThisRoom = convertToStorePanel(panelThisRoom); - SettingsStore.setValue( + void SettingsStore.setValue( "RightPanel.phases", this.viewedRoomId, SettingLevel.ROOM_DEVICE, @@ -449,7 +449,7 @@ export default class RightPanelStore extends ReadyWatchingStore { public static get instance(): RightPanelStore { if (!this.internalInstance) { this.internalInstance = new RightPanelStore(); - this.internalInstance.start(); + void this.internalInstance.start(); } return this.internalInstance; } diff --git a/apps/web/src/stores/room-list-v3/RoomListStoreV3.ts b/apps/web/src/stores/room-list-v3/RoomListStoreV3.ts index ca32311ebef..440c2392819 100644 --- a/apps/web/src/stores/room-list-v3/RoomListStoreV3.ts +++ b/apps/web/src/stores/room-list-v3/RoomListStoreV3.ts @@ -222,7 +222,7 @@ export class RoomListStoreV3Class extends AsyncStoreWithClient { const sorter = this.getSorterFromSortingAlgorithm(algorithm, this.matrixClient.getSafeUserId()); this.roomSkipList.useNewSorter(sorter, this.getRooms()); this.emit(LISTS_UPDATE_EVENT); - SettingsStore.setValue("RoomList.preferredSorting", null, SettingLevel.DEVICE, algorithm); + void SettingsStore.setValue("RoomList.preferredSorting", null, SettingLevel.DEVICE, algorithm); } /** @@ -581,7 +581,7 @@ export default class RoomListStoreV3 { public static get instance(): RoomListStoreV3Class { if (!RoomListStoreV3.internalInstance) { const instance = new RoomListStoreV3Class(defaultDispatcher); - instance.start(); + void instance.start(); RoomListStoreV3.internalInstance = instance; } diff --git a/apps/web/src/stores/spaces/SpaceStore.ts b/apps/web/src/stores/spaces/SpaceStore.ts index 51b2eb67c1c..197a6493823 100644 --- a/apps/web/src/stores/spaces/SpaceStore.ts +++ b/apps/web/src/stores/spaces/SpaceStore.ts @@ -280,14 +280,14 @@ export class SpaceStoreClass extends AsyncStoreWithClient { this.emit(UPDATE_SUGGESTED_ROOMS, (this._suggestedRooms = [])); if (cliSpace) { - this.loadSuggestedRooms(cliSpace); + void this.loadSuggestedRooms(cliSpace); // Load all members for the selected space and its subspaces, // so we can correctly show DMs we have with members of this space. SpaceStore.instance.traverseSpace( space, (roomId) => { - this.matrixClient?.getRoom(roomId)?.loadMembersIfNeeded(); + void this.matrixClient?.getRoom(roomId)?.loadMembersIfNeeded(); }, false, ); @@ -1019,7 +1019,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient { target?.getMyMembership() !== KnownMembership.Join && // target not joined ev.getPrevContent().suggested !== ev.getContent().suggested // suggested flag changed ) { - this.loadSuggestedRooms(room); + void this.loadSuggestedRooms(room); } break; @@ -1398,7 +1398,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient { const changes = reorderLexicographically(currentOrders, fromIndex, toIndex); changes.forEach(({ index, order }) => { - this.setRootSpaceOrder(this.rootSpaces[index], order); + void this.setRootSpaceOrder(this.rootSpaces[index], order); }); this.notifyIfOrderChanged(); @@ -1409,7 +1409,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient { export default class SpaceStore { private static readonly internalInstance = (() => { const instance = new SpaceStoreClass(); - instance.start(); + void instance.start(); return instance; })(); @@ -1422,7 +1422,7 @@ export default class SpaceStore { */ public static testInstance(): SpaceStoreClass { const store = new SpaceStoreClass(); - store.start(); + void store.start(); return store; } } diff --git a/apps/web/src/stores/widgets/WidgetLayoutStore.ts b/apps/web/src/stores/widgets/WidgetLayoutStore.ts index b3f38500978..fba282f1176 100644 --- a/apps/web/src/stores/widgets/WidgetLayoutStore.ts +++ b/apps/web/src/stores/widgets/WidgetLayoutStore.ts @@ -60,7 +60,7 @@ export class WidgetLayoutStore extends ReadyWatchingStore { public static get instance(): WidgetLayoutStore { if (!this.internalInstance) { this.internalInstance = new WidgetLayoutStore(); - this.internalInstance.start(); + void this.internalInstance.start(); } return this.internalInstance; } @@ -472,7 +472,7 @@ export class WidgetLayoutStore extends ReadyWatchingStore { }; } } - this.matrixClient?.sendStateEvent(room.roomId, WIDGET_LAYOUT_EVENT_TYPE, evContent, ""); + void this.matrixClient?.sendStateEvent(room.roomId, WIDGET_LAYOUT_EVENT_TYPE, evContent, ""); } private getAllWidgets(room: Room): [IApp, Container][] { diff --git a/apps/web/src/stores/widgets/WidgetMessaging.ts b/apps/web/src/stores/widgets/WidgetMessaging.ts index b992e871bfb..f7a70ab0a5e 100644 --- a/apps/web/src/stores/widgets/WidgetMessaging.ts +++ b/apps/web/src/stores/widgets/WidgetMessaging.ts @@ -273,7 +273,7 @@ export class WidgetMessaging extends TypedEventEmitter { - this.widgetApi?.updateTheme({ name: theme }); + void this.widgetApi?.updateTheme({ name: theme }); }; private onOpenModal = async (ev: CustomEvent): Promise => { @@ -440,7 +440,9 @@ export class WidgetMessaging extends TypedEventEmitter { - this.client.decryptEventIfNeeded(ev); + void this.client.decryptEventIfNeeded(ev); this.feedEvent(ev); }; diff --git a/apps/web/src/stores/widgets/WidgetMessagingStore.ts b/apps/web/src/stores/widgets/WidgetMessagingStore.ts index a9ec3d765f7..21c12ff62da 100644 --- a/apps/web/src/stores/widgets/WidgetMessagingStore.ts +++ b/apps/web/src/stores/widgets/WidgetMessagingStore.ts @@ -29,7 +29,7 @@ export enum WidgetMessagingStoreEvent { export class WidgetMessagingStore extends AsyncStoreWithClient { private static readonly internalInstance = (() => { const instance = new WidgetMessagingStore(); - instance.start(); + void instance.start(); return instance; })(); diff --git a/apps/web/src/stores/widgets/WidgetPermissionStore.ts b/apps/web/src/stores/widgets/WidgetPermissionStore.ts index 026438e1c42..d8d5dac22c3 100644 --- a/apps/web/src/stores/widgets/WidgetPermissionStore.ts +++ b/apps/web/src/stores/widgets/WidgetPermissionStore.ts @@ -69,6 +69,6 @@ export class WidgetPermissionStore { currentValues.deny = currentValues.deny.filter((c) => c !== settingsKey); } - SettingsStore.setValue("widgetOpenIDPermissions", null, SettingLevel.DEVICE, currentValues); + void SettingsStore.setValue("widgetOpenIDPermissions", null, SettingLevel.DEVICE, currentValues); } } diff --git a/apps/web/src/toasts/AnalyticsToast.tsx b/apps/web/src/toasts/AnalyticsToast.tsx index 40d4643e935..7e50611f7b0 100644 --- a/apps/web/src/toasts/AnalyticsToast.tsx +++ b/apps/web/src/toasts/AnalyticsToast.tsx @@ -38,7 +38,7 @@ const onLearnMoreNoOptIn = (): void => { primaryButton: _t("action|enable"), }); - finished.then(([buttonClicked]) => { + void finished.then(([buttonClicked]) => { if (buttonClicked === ButtonClicked.Primary) { // user clicked "Enable" onAccept(); @@ -54,7 +54,7 @@ const onLearnMorePreviouslyOptedIn = (): void => { cancelButton: _t("action|stop"), }); - finished.then(([buttonClicked]) => { + void finished.then(([buttonClicked]) => { if (buttonClicked === ButtonClicked.Primary) { // user clicked "That's fine" onAccept(); diff --git a/apps/web/src/toasts/DesktopNotificationsToast.ts b/apps/web/src/toasts/DesktopNotificationsToast.ts index fb9dd4ec1af..358f59e6d4f 100644 --- a/apps/web/src/toasts/DesktopNotificationsToast.ts +++ b/apps/web/src/toasts/DesktopNotificationsToast.ts @@ -22,7 +22,7 @@ export const showToast = (notifier: Notifier, fromMessageSend: boolean): void => await SettingsStore.setValue("notificationsEnabled", null, SettingLevel.DEVICE, true); const cli = MatrixClientPeg.safeGet(); const eventType = getLocalNotificationAccountDataEventType(cli.deviceId); - cli.setAccountData(eventType, { + void cli.setAccountData(eventType, { is_silenced: false, }); }; diff --git a/apps/web/src/toasts/UpdateToast.tsx b/apps/web/src/toasts/UpdateToast.tsx index 4ced8144c18..46600e300f4 100644 --- a/apps/web/src/toasts/UpdateToast.tsx +++ b/apps/web/src/toasts/UpdateToast.tsx @@ -37,7 +37,7 @@ export const showToast = (version: string, newVersion: string, releaseNotes?: st description:
    {releaseNotes}
    , button: _t("action|update"), }); - finished.then(([update]) => { + void finished.then(([update]) => { if (update && PlatformPeg.get()) { PlatformPeg.get()!.installUpdate(); } @@ -49,7 +49,7 @@ export const showToast = (version: string, newVersion: string, releaseNotes?: st version, newVersion, }); - finished.then(([update]) => { + void finished.then(([update]) => { if (update && PlatformPeg.get()) { PlatformPeg.get()!.installUpdate(); } diff --git a/apps/web/src/utils/DMRoomMap.ts b/apps/web/src/utils/DMRoomMap.ts index 3153ed88fab..e889babf302 100644 --- a/apps/web/src/utils/DMRoomMap.ts +++ b/apps/web/src/utils/DMRoomMap.ts @@ -231,7 +231,7 @@ export default class DMRoomMap { logger.warn(`Invalid m.direct account data detected (self-chats that shouldn't be), patching it up.`); if (neededPatching && !this.hasSentOutPatchDirectAccountDataPatch) { this.hasSentOutPatchDirectAccountDataPatch = true; - this.matrixClient.setAccountData(EventType.Direct, userToRooms); + void this.matrixClient.setAccountData(EventType.Direct, userToRooms); } } this.userToRooms = userToRooms; diff --git a/apps/web/src/utils/DialogOpener.ts b/apps/web/src/utils/DialogOpener.ts index 1130245ffff..1e6a540437f 100644 --- a/apps/web/src/utils/DialogOpener.ts +++ b/apps/web/src/utils/DialogOpener.ts @@ -104,7 +104,7 @@ export class DialogOpener { ); break; case Action.OpenInviteDialog: - Modal.createDialog( + void Modal.createDialog( InviteDialog, { kind: payload.kind, @@ -124,7 +124,7 @@ export class DialogOpener { AddExistingToSpaceDialog, { onCreateRoomClick: (ev: ButtonEvent) => { - showCreateNewRoom(space); + void showCreateNewRoom(space); PosthogTrackers.trackInteraction("WebAddExistingToSpaceDialogCreateRoomButton", ev); }, onAddSubspaceClick: () => showAddExistingSubspace(space), @@ -132,7 +132,7 @@ export class DialogOpener { }, "mx_AddExistingToSpaceDialog_wrapper", ); - finished.then(([added]) => { + void finished.then(([added]) => { if (added && SDKContextClass.instance.roomViewStore.getRoomId() === space.roomId) { defaultDispatcher.fire(Action.UpdateSpaceHierarchy); } diff --git a/apps/web/src/utils/IdentityServerUtils.ts b/apps/web/src/utils/IdentityServerUtils.ts index df4f269c34e..b3f154594bc 100644 --- a/apps/web/src/utils/IdentityServerUtils.ts +++ b/apps/web/src/utils/IdentityServerUtils.ts @@ -18,7 +18,7 @@ export function getDefaultIdentityServerUrl(): string | undefined { export function setToDefaultIdentityServer(matrixClient: MatrixClient): void { const url = getDefaultIdentityServerUrl(); // Account data change will update localstorage, client, etc through dispatcher - matrixClient.setAccountData("m.identity_server", { + void matrixClient.setAccountData("m.identity_server", { base_url: url ?? null, }); } diff --git a/apps/web/src/utils/MultiInviter.ts b/apps/web/src/utils/MultiInviter.ts index 09ae6adb9c9..a3181cc2c8f 100644 --- a/apps/web/src/utils/MultiInviter.ts +++ b/apps/web/src/utils/MultiInviter.ts @@ -356,7 +356,7 @@ export default class MultiInviter { return new Promise((resolve) => { const inviteUnknowns = (): void => { const promises = unknownProfileUsers.map((u) => this.doInvite(u, true)); - Promise.all(promises).then(() => resolve()); + void Promise.all(promises).then(() => resolve()); }; if (!SettingsStore.getValue("promptBeforeInviteUnknownUsers", this.roomId)) { diff --git a/apps/web/src/utils/ReactUtils.tsx b/apps/web/src/utils/ReactUtils.tsx index 40217b1adb5..02ee4451816 100644 --- a/apps/web/src/utils/ReactUtils.tsx +++ b/apps/web/src/utils/ReactUtils.tsx @@ -18,7 +18,7 @@ export function jsxJoin(array: ReactNode[], joiner?: string | JSX.Element): JSX. return ( <> {array.map((element, index) => ( - + {element} {index === array.length - 1 ? null : joiner} diff --git a/apps/web/src/utils/StorageManager.ts b/apps/web/src/utils/StorageManager.ts index 478d30af6ff..c2803cff1e8 100644 --- a/apps/web/src/utils/StorageManager.ts +++ b/apps/web/src/utils/StorageManager.ts @@ -28,7 +28,7 @@ function error(msg: string, ...args: any[]): void { export function tryPersistStorage(): void { if (navigator.storage && navigator.storage.persist) { - navigator.storage.persist().then((persistent) => { + void navigator.storage.persist().then((persistent) => { logger.log("StorageManager: Persistent?", persistent); }); } else if (document.requestStorageAccess) { diff --git a/apps/web/src/utils/WidgetUtils.ts b/apps/web/src/utils/WidgetUtils.ts index 56107b10a98..04cb9a26a87 100644 --- a/apps/web/src/utils/WidgetUtils.ts +++ b/apps/web/src/utils/WidgetUtils.ts @@ -535,7 +535,7 @@ export default class WidgetUtils { public static editWidget(room: Room, app: IWidget): void { // noinspection JSIgnoredPromiseFromCall - IntegrationManagers.sharedInstance() + void IntegrationManagers.sharedInstance() .getPrimaryManager() ?.open(room, "type_" + app.type, app.id); } diff --git a/apps/web/src/utils/device/clientInformation.ts b/apps/web/src/utils/device/clientInformation.ts index 3c2fb544bdb..2290f1a4b37 100644 --- a/apps/web/src/utils/device/clientInformation.ts +++ b/apps/web/src/utils/device/clientInformation.ts @@ -68,7 +68,7 @@ export const pruneClientInformation = (validDeviceIds: string[], matrixClient: M } const [, deviceId] = event.getType().split(clientInformationEventPrefix); if (deviceId && !validDeviceIds.includes(deviceId)) { - matrixClient.deleteAccountData(event.getType() as keyof AccountDataEvents); + void matrixClient.deleteAccountData(event.getType() as keyof AccountDataEvents); } }); }; diff --git a/apps/web/src/utils/dm/createDmLocalRoom.ts b/apps/web/src/utils/dm/createDmLocalRoom.ts index e29d808ff5f..f38ae6aa3b0 100644 --- a/apps/web/src/utils/dm/createDmLocalRoom.ts +++ b/apps/web/src/utils/dm/createDmLocalRoom.ts @@ -109,7 +109,7 @@ export async function createDmLocalRoom(client: MatrixClient, targets: Member[]) localRoom.targets = targets; localRoom.updateMyMembership(KnownMembership.Join); - localRoom.addLiveEvents(events, { addToState: true }); + void localRoom.addLiveEvents(events, { addToState: true }); localRoom.currentState.setStateEvents(events); localRoom.name = localRoom.getDefaultRoomName(client.getUserId()!); client.store.storeRoom(localRoom); diff --git a/apps/web/src/utils/leave-behaviour.test.ts b/apps/web/src/utils/leave-behaviour.test.ts index ce67c3a2986..154f48a194f 100644 --- a/apps/web/src/utils/leave-behaviour.test.ts +++ b/apps/web/src/utils/leave-behaviour.test.ts @@ -74,7 +74,7 @@ describe("leaveRoomBehaviour", () => { true, ); - const expectDispatch = async (payload: T) => { + const expectDispatch = async (payload: ActionPayload) => { const dispatcherSpy = vi.fn(); const dispatcherRef = defaultDispatcher.register(dispatcherSpy); await sleep(0); diff --git a/apps/web/src/utils/leave-behaviour.ts b/apps/web/src/utils/leave-behaviour.ts index 12c3e81168b..7744396a3a8 100644 --- a/apps/web/src/utils/leave-behaviour.ts +++ b/apps/web/src/utils/leave-behaviour.ts @@ -197,7 +197,7 @@ export const leaveSpace = (space: Room): void => { }, "mx_LeaveSpaceDialog_wrapper", ); - finished.then(async ([leave, rooms]) => { + void finished.then(async ([leave, rooms]) => { if (!leave) return; await bulkSpaceBehaviour(space, rooms!, (room) => leaveRoomBehaviour(space.client, room.roomId)); diff --git a/apps/web/src/utils/promise.ts b/apps/web/src/utils/promise.ts index 919b925a5bc..51c93c53646 100644 --- a/apps/web/src/utils/promise.ts +++ b/apps/web/src/utils/promise.ts @@ -11,7 +11,7 @@ Please see LICENSE files in the repository root for full details. export async function timeout(promise: Promise, timeoutValue: Y, ms: number): Promise { const timeoutPromise = new Promise((resolve) => { const timeoutId = window.setTimeout(resolve, ms, timeoutValue); - promise.then(() => { + void promise.then(() => { clearTimeout(timeoutId); }); }); diff --git a/apps/web/src/utils/space.tsx b/apps/web/src/utils/space.tsx index a794c6c0501..d153f3db8bc 100644 --- a/apps/web/src/utils/space.tsx +++ b/apps/web/src/utils/space.tsx @@ -114,7 +114,7 @@ export const showAddExistingSubspace = (space: Room): void => { }, "mx_AddExistingToSpaceDialog_wrapper", ); - finished.then(([added]) => { + void finished.then(([added]) => { if (added && SDKContextClass.instance.roomViewStore.getRoomId() === space.roomId) { defaultDispatcher.fire(Action.UpdateSpaceHierarchy); } @@ -130,7 +130,7 @@ export const showCreateNewSubspace = (space: Room): void => { }, "mx_CreateSubspaceDialog_wrapper", ); - finished.then(([added]) => { + void finished.then(([added]) => { if (added && SDKContextClass.instance.roomViewStore.getRoomId() === space.roomId) { defaultDispatcher.fire(Action.UpdateSpaceHierarchy); } diff --git a/apps/web/src/vector/jitsi/index.ts b/apps/web/src/vector/jitsi/index.ts index c90dbc86574..f9c9199c0f7 100644 --- a/apps/web/src/vector/jitsi/index.ts +++ b/apps/web/src/vector/jitsi/index.ts @@ -549,4 +549,4 @@ const updateParticipants = (): void => { }; const onLog = ({ logLevel, args }: LogEvent): void => - (parent as unknown as typeof global).mx_rage_logger?.log(logLevel, ...args); + (parent as unknown as typeof global).mx_rage_logger?.log(logLevel, args); diff --git a/apps/web/src/viewmodels/menus/UserMenuViewModel.ts b/apps/web/src/viewmodels/menus/UserMenuViewModel.ts index 4630ca55642..b14142b26ab 100644 --- a/apps/web/src/viewmodels/menus/UserMenuViewModel.ts +++ b/apps/web/src/viewmodels/menus/UserMenuViewModel.ts @@ -83,7 +83,7 @@ export class UserMenuViewModel super(props, UserMenuViewModel.computeSnapshot(client, props.ownProfileStore, isPanelCollapsed)); this.setStatusVm = new UserMenuSetStatusViewModel({ client, ownProfileStore: props.ownProfileStore }); props.ownProfileStore.on(UPDATE_EVENT, this.recalculateProfile); - this.loadAuthMetadata(); + void this.loadAuthMetadata(); } public dispose(): void { diff --git a/apps/web/src/viewmodels/message-body/FileBodyViewModel.ts b/apps/web/src/viewmodels/message-body/FileBodyViewModel.ts index d5033d37426..5cbb78a2c1a 100644 --- a/apps/web/src/viewmodels/message-body/FileBodyViewModel.ts +++ b/apps/web/src/viewmodels/message-body/FileBodyViewModel.ts @@ -50,7 +50,7 @@ async function cacheDownloadIcon(): Promise { // Cache the asset immediately // noinspection JSIgnoredPromiseFromCall -cacheDownloadIcon(); +void cacheDownloadIcon(); // User supplied content can contain scripts, we have to be careful that // we don't accidentally run those script within the same origin as the @@ -223,7 +223,7 @@ export class FileBodyViewModel private downloadFile(fileName: string, text: string): void { if (!this.decryptedBlob) return; - this.fileDownloader.download({ + void this.fileDownloader.download({ blob: this.decryptedBlob, name: fileName, autoDownload: this.userDidClick, @@ -264,7 +264,7 @@ export class FileBodyViewModel return; } - this.fileDownloader.download({ + void this.fileDownloader.download({ blob: await this.props.mediaEventHelper.sourceBlob.value, name: this.fileName, }); @@ -281,7 +281,7 @@ export class FileBodyViewModel const fileType = this.content.info?.mimetype ?? "application/octet-stream"; logger.log(`Downloading ${fileType} as blob (unencrypted)`); - this.props.mediaEventHelper.sourceBlob.value.then((blob) => { + void this.props.mediaEventHelper.sourceBlob.value.then((blob) => { const blobUrl = URL.createObjectURL(blob); const tempAnchor = document.createElement("a"); tempAnchor.download = this.fileName; diff --git a/apps/web/src/viewmodels/message-body/VideoBodyViewModel.ts b/apps/web/src/viewmodels/message-body/VideoBodyViewModel.ts index fd4b9ee8ee7..ffcb3f47f7d 100644 --- a/apps/web/src/viewmodels/message-body/VideoBodyViewModel.ts +++ b/apps/web/src/viewmodels/message-body/VideoBodyViewModel.ts @@ -521,7 +521,7 @@ export class VideoBodyViewModel fetchingData: false, }; this.updateSnapshotFromState(); - this.props.videoRef.current?.play(); + void this.props.videoRef.current?.play(); } catch (error) { if ( this.isDisposed || diff --git a/apps/web/src/viewmodels/room-list/RoomListHeaderViewModel.ts b/apps/web/src/viewmodels/room-list/RoomListHeaderViewModel.ts index 548aa8f03d5..1715e5e820e 100644 --- a/apps/web/src/viewmodels/room-list/RoomListHeaderViewModel.ts +++ b/apps/web/src/viewmodels/room-list/RoomListHeaderViewModel.ts @@ -155,7 +155,7 @@ export class RoomListHeaderViewModel }; public createRoom = (e: Event): void => { - createRoom(this.activeSpace); + void createRoom(this.activeSpace); PosthogTrackers.trackInteraction("WebRoomListHeaderPlusMenuCreateRoomItem", e); }; @@ -164,7 +164,7 @@ export class RoomListHeaderViewModel ? RoomType.UnstableCall : RoomType.ElementVideo; if (this.activeSpace) { - showCreateNewRoom(this.activeSpace, type); + void showCreateNewRoom(this.activeSpace, type); } else { defaultDispatcher.dispatch({ action: Action.CreateRoom, @@ -224,12 +224,12 @@ export class RoomListHeaderViewModel PosthogTrackers.trackInteraction("WebRoomListMessagePreviewToggle"); const isMessagePreviewEnabled = !SettingsStore.getValue("RoomList.showMessagePreview"); - SettingsStore.setValue("RoomList.showMessagePreview", null, SettingLevel.DEVICE, isMessagePreviewEnabled); + void SettingsStore.setValue("RoomList.showMessagePreview", null, SettingLevel.DEVICE, isMessagePreviewEnabled); this.snapshot.merge({ isMessagePreviewEnabled }); }; public createSection = (): void => { - RoomListStoreV3.instance.createSection(); + void RoomListStoreV3.instance.createSection(); PosthogTrackers.trackSectionCreation("RoomListHeader"); }; @@ -254,7 +254,7 @@ export class RoomListHeaderViewModel }; public closeSectionReleaseAnnouncement = (): void => { - ReleaseAnnouncementStore.instance.nextReleaseAnnouncement(); + void ReleaseAnnouncementStore.instance.nextReleaseAnnouncement(); this.snapshot.merge({ displaySectionReleaseAnnouncement: false }); }; diff --git a/apps/web/src/viewmodels/room-list/RoomListViewModel.ts b/apps/web/src/viewmodels/room-list/RoomListViewModel.ts index 9b913475b46..e48ec835b01 100644 --- a/apps/web/src/viewmodels/room-list/RoomListViewModel.ts +++ b/apps/web/src/viewmodels/room-list/RoomListViewModel.ts @@ -246,7 +246,7 @@ export class RoomListViewModel // Update roomsMap immediately before clearing VMs this.updateRoomsMap(this.roomsResult); - this.updateRoomListData(); + void this.updateRoomListData(); }; /** @@ -506,7 +506,7 @@ export class RoomListViewModel if (payload.action === Action.ActiveRoomChanged) { // When the active room changes, update the room list data to reflect the new selected room // Pass isRoomChange=true so sticky logic doesn't prevent the index from updating - this.updateRoomListData(true); + void this.updateRoomListData(true); } else if (payload.action === Action.ViewRoomDelta) { // Handle keyboard navigation shortcuts (Alt+ArrowUp/Down) // This was previously handled by useRoomListNavigation hook @@ -528,7 +528,7 @@ export class RoomListViewModel for (const sectionHeaderVM of this.roomSectionHeaderViewModels.values()) { sectionHeaderVM.isExpanded = expand; } - this.updateRoomListData(); + void this.updateRoomListData(); } /** @@ -610,14 +610,14 @@ export class RoomListViewModel // Space changed - get the last selected room for the new space to prevent flicker const lastSelectedRoom = SpaceStore.instance.getLastSelectedRoomIdForSpace(newSpaceId); - this.updateRoomListData(true, lastSelectedRoom); + void this.updateRoomListData(true, lastSelectedRoom); return; } this.updateRoomsMap(this.roomsResult); // Normal room list update (not a space change) - this.updateRoomListData(); + void this.updateRoomListData(); }; private onListsLoaded = (): void => { @@ -838,7 +838,7 @@ export class RoomListViewModel const filterKeys = this.activeFilter !== undefined ? [this.activeFilter] : undefined; this.roomsResult = RoomListStoreV3.instance.getSortedRoomsInActiveSpace(filterKeys); this.updateRoomsMap(this.roomsResult); - this.updateRoomListData(false, null, tag); + void this.updateRoomListData(false, null, tag); this.showToast("section_created"); }; @@ -885,7 +885,7 @@ export class RoomListViewModel const filterKeys = this.activeFilter !== undefined ? [this.activeFilter] : undefined; this.roomsResult = RoomListStoreV3.instance.getSortedRoomsInActiveSpace(filterKeys); this.updateRoomsMap(this.roomsResult); - this.updateRoomListData(false, null, sourceTag); + void this.updateRoomListData(false, null, sourceTag); }; public onSectionDragStart = (): void => { @@ -894,7 +894,7 @@ export class RoomListViewModel this.savedExpansionStates.set(tag, sectionVM.isExpanded); sectionVM.isExpanded = false; } - this.updateRoomListData(); + void this.updateRoomListData(); }; public onSectionDragEnd = (): void => { @@ -903,7 +903,7 @@ export class RoomListViewModel if (sectionVM) sectionVM.isExpanded = expanded; } this.savedExpansionStates.clear(); - this.updateRoomListData(); + void this.updateRoomListData(); }; public changeRoomSection = (roomId: string, tag: string): void => { diff --git a/apps/web/src/viewmodels/room/EventTileActionBarViewModel.ts b/apps/web/src/viewmodels/room/EventTileActionBarViewModel.ts index ab6dacde494..278d81307a2 100644 --- a/apps/web/src/viewmodels/room/EventTileActionBarViewModel.ts +++ b/apps/web/src/viewmodels/room/EventTileActionBarViewModel.ts @@ -265,7 +265,7 @@ export class EventTileActionBarViewModel this.addListenerCleanup(() => roomState.off(RoomStateEvent.Events, this.onRoomEvent)); } - MatrixClientPeg.safeGet().decryptEventIfNeeded(mxEvent); + void MatrixClientPeg.safeGet().decryptEventIfNeeded(mxEvent); void this.updateDownloadPermission(++this.downloadPermissionRequestId); } diff --git a/apps/web/src/viewmodels/room/RoomUploadViewModel.tsx b/apps/web/src/viewmodels/room/RoomUploadViewModel.tsx index dd0ca4a0a54..1cf6eb6e1e4 100644 --- a/apps/web/src/viewmodels/room/RoomUploadViewModel.tsx +++ b/apps/web/src/viewmodels/room/RoomUploadViewModel.tsx @@ -190,7 +190,7 @@ export class RoomUploadViewModel if (![TimelineRenderingType.Room, TimelineRenderingType.Thread].includes(this.timelineRenderingType)) { throw new Error("TimelineRenderingType must be Room or Thread"); } - fn( + void fn( this.room.roomId, { view: this.timelineRenderingType === TimelineRenderingType.Room ? "room" : "thread", @@ -295,7 +295,7 @@ export function RoomUploadContextProvider({ timelineRenderingType, threadRelation, ); - vm.initiateViaInputFiles(fileInsert.files); + void vm.initiateViaInputFiles(fileInsert.files); } }); diff --git a/apps/web/src/viewmodels/room/right-panel/WidgetContextMenuViewModel.tsx b/apps/web/src/viewmodels/room/right-panel/WidgetContextMenuViewModel.tsx index 389d26e7df0..16652e71522 100644 --- a/apps/web/src/viewmodels/room/right-panel/WidgetContextMenuViewModel.tsx +++ b/apps/web/src/viewmodels/room/right-panel/WidgetContextMenuViewModel.tsx @@ -163,9 +163,9 @@ export class WidgetContextMenuViewModel button: _t("widget|context_menu|delete"), }); - finished.then(([confirmed]) => { + void finished.then(([confirmed]) => { if (!confirmed) return; - WidgetUtils.setRoomWidget(this._cli, this._roomId!, this._app.id); + void WidgetUtils.setRoomWidget(this._cli, this._roomId!, this._app.id); }); } diff --git a/apps/web/src/viewmodels/room/timeline/event-tile/body/AudioPlayerViewModel.ts b/apps/web/src/viewmodels/room/timeline/event-tile/body/AudioPlayerViewModel.ts index e114cf8ee6e..e1e5eab0535 100644 --- a/apps/web/src/viewmodels/room/timeline/event-tile/body/AudioPlayerViewModel.ts +++ b/apps/web/src/viewmodels/room/timeline/event-tile/body/AudioPlayerViewModel.ts @@ -83,7 +83,7 @@ export class AudioPlayerViewModel // Don't wait for the promise to complete - it will emit a progress update when it // is done, and it's not meant to take long anyhow. - this.preparePlayback(); + void this.preparePlayback(); } /** @@ -113,13 +113,13 @@ export class AudioPlayerViewModel switch (action) { case KeyBindingAction.Space: - this.togglePlay(); + void this.togglePlay(); break; case KeyBindingAction.ArrowLeft: - this.props.playback.skipTo(this.props.playback.timeSeconds - ARROW_SKIP_SECONDS); + void this.props.playback.skipTo(this.props.playback.timeSeconds - ARROW_SKIP_SECONDS); break; case KeyBindingAction.ArrowRight: - this.props.playback.skipTo(this.props.playback.timeSeconds + ARROW_SKIP_SECONDS); + void this.props.playback.skipTo(this.props.playback.timeSeconds + ARROW_SKIP_SECONDS); break; default: handled = false; diff --git a/apps/web/src/viewmodels/room/timeline/event-tile/body/TextualBodyViewModel.tsx b/apps/web/src/viewmodels/room/timeline/event-tile/body/TextualBodyViewModel.tsx index b0d5b9baa58..c839ef679cb 100644 --- a/apps/web/src/viewmodels/room/timeline/event-tile/body/TextualBodyViewModel.tsx +++ b/apps/web/src/viewmodels/room/timeline/event-tile/body/TextualBodyViewModel.tsx @@ -313,7 +313,7 @@ export class TextualBodyViewModel const integrationManager = managers.getPrimaryManager(); const scalarClient = integrationManager?.getScalarClient(); - scalarClient?.connect().then(() => { + void scalarClient?.connect().then(() => { const completeUrl = scalarClient.getStarterLink(starterLink); const integrationsUrl = integrationManager!.uiUrl; const { finished } = Modal.createDialog(QuestionDialog, { @@ -322,7 +322,7 @@ export class TextualBodyViewModel button: _t("action|continue"), }); - finished.then(([confirmed]) => { + void finished.then(([confirmed]) => { if (!confirmed) { return; } diff --git a/apps/web/src/viewmodels/room/timeline/event-tile/body/ViewSourceEventViewModel.ts b/apps/web/src/viewmodels/room/timeline/event-tile/body/ViewSourceEventViewModel.ts index d574ee15726..515fabd7438 100644 --- a/apps/web/src/viewmodels/room/timeline/event-tile/body/ViewSourceEventViewModel.ts +++ b/apps/web/src/viewmodels/room/timeline/event-tile/body/ViewSourceEventViewModel.ts @@ -91,7 +91,7 @@ export class ViewSourceEventViewModel this.removeDecryptionListener(); const { cli, mxEvent } = this.props; - cli.decryptEventIfNeeded(mxEvent); + void cli.decryptEventIfNeeded(mxEvent); if (!mxEvent.isBeingDecrypted()) return; diff --git a/apps/web/src/viewmodels/room/timeline/event-tile/reactions/ReactionsRowButtonViewModel.ts b/apps/web/src/viewmodels/room/timeline/event-tile/reactions/ReactionsRowButtonViewModel.ts index 591a9073c73..affb3a7e8c8 100644 --- a/apps/web/src/viewmodels/room/timeline/event-tile/reactions/ReactionsRowButtonViewModel.ts +++ b/apps/web/src/viewmodels/room/timeline/event-tile/reactions/ReactionsRowButtonViewModel.ts @@ -195,11 +195,11 @@ export class ReactionsRowButtonViewModel if (disabled) return; if (myReactionEvent) { - client.redactEvent(mxEvent.getRoomId()!, myReactionEvent.getId()!); + void client.redactEvent(mxEvent.getRoomId()!, myReactionEvent.getId()!); return; } - client.sendEvent(mxEvent.getRoomId()!, EventType.Reaction, { + void client.sendEvent(mxEvent.getRoomId()!, EventType.Reaction, { "m.relates_to": { rel_type: RelationType.Annotation, event_id: mxEvent.getId()!, diff --git a/apps/web/src/viewmodels/structures/ResizerViewModel.ts b/apps/web/src/viewmodels/structures/ResizerViewModel.ts index 2d9da268db0..666c5020c42 100644 --- a/apps/web/src/viewmodels/structures/ResizerViewModel.ts +++ b/apps/web/src/viewmodels/structures/ResizerViewModel.ts @@ -70,13 +70,13 @@ export class ResizerViewModel const isCollapsed = newSize === 0; // Store the size if the panel isn't collapsed. if (!isCollapsed) { - SettingsStore.setValue("RoomList.panelSize", null, SettingLevel.DEVICE, newSize); + void SettingsStore.setValue("RoomList.panelSize", null, SettingLevel.DEVICE, newSize); } // Store whether the panel was collapsed. // This is stored separately instead of being inferred from the stored panel size so that // the panel can be restored to its last known non-zero width even after app reload, which // we wouldn't be able to do if we stored panelSize as zero. - SettingsStore.setValue("RoomList.isPanelCollapsed", null, SettingLevel.DEVICE, isCollapsed); + void SettingsStore.setValue("RoomList.isPanelCollapsed", null, SettingLevel.DEVICE, isCollapsed); }; public setPanelHandle = (handle: PanelImperativeHandle): void => { diff --git a/apps/web/src/widgets/Jitsi.ts b/apps/web/src/widgets/Jitsi.ts index c3eecb6a5c4..953732255e6 100644 --- a/apps/web/src/widgets/Jitsi.ts +++ b/apps/web/src/widgets/Jitsi.ts @@ -63,7 +63,7 @@ export class Jitsi { const cli = MatrixClientPeg.safeGet(); cli.on(ClientEvent.ClientWellKnown, this.update); // call update initially in case we missed the first WellKnown.client event and for if no well-known present - this.update(cli.getClientWellKnown()); + void this.update(cli.getClientWellKnown()); } private update = async (discoveryResponse?: IClientWellKnown): Promise => { diff --git a/apps/web/test/unit-tests/accessibility/LandmarkNavigation-test.tsx b/apps/web/test/unit-tests/accessibility/LandmarkNavigation-test.tsx index 878981f708e..f46cf989ad9 100644 --- a/apps/web/test/unit-tests/accessibility/LandmarkNavigation-test.tsx +++ b/apps/web/test/unit-tests/accessibility/LandmarkNavigation-test.tsx @@ -16,18 +16,18 @@ describe("KeyboardLandmarkUtils", () => { it("Landmarks are cycled through correctly without an opened room", () => { render(
    -
    +
    -
    + +
    -
    + +
    -
    + +
    +
    , ); // ACTIVE_SPACE_BUTTON <-> ROOM_SEARCH <-> ROOM_LIST <-> HOME <-> ACTIVE_SPACE_BUTTON @@ -69,21 +69,19 @@ describe("KeyboardLandmarkUtils", () => { defaultDispatcher.register(callback); render(
    -
    +
    -
    + +
    -
    + +
    -
    + +
    + +
    , ); // ACTIVE_SPACE_BUTTON <-> ROOM_SEARCH <-> ROOM_LIST <-> MESSAGE_COMPOSER <-> ACTIVE_SPACE_BUTTON diff --git a/oxlint.config.ts b/oxlint.config.ts index 1f629ef9b93..d73ac801231 100644 --- a/oxlint.config.ts +++ b/oxlint.config.ts @@ -153,16 +153,12 @@ export default defineConfig({ "typescript/restrict-template-expressions": "off", "typescript/no-redundant-type-constituents": "off", "typescript/no-useless-default-assignment": "off", - "typescript/no-floating-promises": "off", - "typescript/no-misused-spread": "off", - "no-extra-boolean-cast": "off", "react-perf/jsx-no-new-function-as-prop": "off", "react-perf/jsx-no-new-object-as-prop": "off", "react-perf/jsx-no-jsx-as-prop": "off", "jsx-a11y/prefer-tag-over-role": "off", "jsx-a11y/no-autofocus": "off", "react/no-children-prop": "off", - "jsx-a11y/no-noninteractive-tabindex": "off", "react-perf/jsx-no-new-array-as-prop": "off", "react/no-did-update-set-state": "off", "react/no-did-mount-set-state": "off", @@ -170,8 +166,6 @@ export default defineConfig({ "jsx-a11y/no-static-element-interactions": "off", "jsx-a11y/click-events-have-key-events": "off", "jsx-a11y/no-noninteractive-element-interactions": "off", - "react/no-array-index-key": "off", - "jsx-a11y/control-has-associated-label": "off", "jsx-a11y/role-supports-aria-props": "off", "jsx-a11y/media-has-caption": "off", "jsx-a11y/no-noninteractive-element-to-interactive-role": "off", @@ -404,7 +398,7 @@ export default defineConfig({ { files: [ "{packages,apps,modules}/*/src/**/*.{test,stories}.{ts,tsx}", - "{packages,apps,modules}/*/src/{tests,__mocks__}/*.{ts,tsx}", + "{packages,apps,modules}/*/src/{test,tests,__mocks__}/*.{ts,tsx}", "{packages,apps,modules}/*/{test,playwright,e2e}/**/*", "{packages,apps,modules}/*/playwright.config.ts", "{packages,apps,modules}/*/.storybook/**/*", @@ -441,7 +435,6 @@ export default defineConfig({ ], "jsdoc/check-tag-names": "off", - "react/jsx-no-constructed-context-values": "off", "jsx-a11y/interactive-supports-focus": "off", "jsx-a11y/no-static-element-interactions": "off", "react/no-array-index-key": "off", @@ -453,6 +446,10 @@ export default defineConfig({ "no-new": "off", "react/iframe-missing-sandbox": "off", "promise/no-promise-in-callback": "off", + + // Disable some react perf related rules in tests + "react/jsx-no-constructed-context-values": "off", + // This would be good to enable in the future "typescript/await-thenable": "off", diff --git a/packages/shared-components/src/core/VirtualizedList/virtualized-list.test.tsx b/packages/shared-components/src/core/VirtualizedList/virtualized-list.test.tsx index c9b31f272e1..d677707adf3 100644 --- a/packages/shared-components/src/core/VirtualizedList/virtualized-list.test.tsx +++ b/packages/shared-components/src/core/VirtualizedList/virtualized-list.test.tsx @@ -165,6 +165,7 @@ const groupedVariant: ListTestVariant = {
    onFocus(header, e)} > diff --git a/packages/shared-components/src/core/i18n/i18n.tsx b/packages/shared-components/src/core/i18n/i18n.tsx index ea6e0cf419e..e468ad9ba00 100644 --- a/packages/shared-components/src/core/i18n/i18n.tsx +++ b/packages/shared-components/src/core/i18n/i18n.tsx @@ -139,7 +139,7 @@ function safeCounterpartTranslate(text: string, variables?: IVariables): { trans /** * The value a variable or tag can take for a translation interpolation. */ -type SubstitutionValue = number | string | React.ReactNode | ((sub: string) => React.ReactNode); +type SubstitutionValue = number | string | Awaited | ((sub: string) => Awaited); // Variables that are guaranteed to only contain primitive (string-safe) values export interface StringVariables { diff --git a/packages/shared-components/src/core/utils/applyReplacerOnString.tsx b/packages/shared-components/src/core/utils/applyReplacerOnString.tsx index 334ae1fd99b..bf5ab310269 100644 --- a/packages/shared-components/src/core/utils/applyReplacerOnString.tsx +++ b/packages/shared-components/src/core/utils/applyReplacerOnString.tsx @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com Please see LICENSE files in the repository root for full details. */ -import React, { type JSX } from "react"; +import { type JSX } from "react"; import { Text, type HTMLReactParserOptions } from "html-react-parser"; type Replacer = HTMLReactParserOptions["replace"]; @@ -28,7 +28,7 @@ export function applyReplacerOnString( const arr = Array.isArray(input) ? input : [input]; return arr.map((item, index): JSX.Element => { if (typeof item === "string") { - return {(replacer(new Text(item), 0) as JSX.Element) || item}; + return (replacer(new Text(item), 0) as JSX.Element) || item; } return item; }); diff --git a/packages/shared-components/src/crypto/SasEmoji/SasEmoji.tsx b/packages/shared-components/src/crypto/SasEmoji/SasEmoji.tsx index bc9ae901851..4cbcc5e910e 100644 --- a/packages/shared-components/src/crypto/SasEmoji/SasEmoji.tsx +++ b/packages/shared-components/src/crypto/SasEmoji/SasEmoji.tsx @@ -31,6 +31,7 @@ export function SasEmoji({ emoji, className }: Props): JSX.Element { const { language } = useI18n(); const emojiBlocks = emoji.map((emoji, i) => ( + // oxlint-disable-next-line react/no-array-index-key
    {emoji} diff --git a/packages/shared-components/src/room-list/RoomListPrimaryFilters/RoomListPrimaryFilters.tsx b/packages/shared-components/src/room-list/RoomListPrimaryFilters/RoomListPrimaryFilters.tsx index f0cde895856..7cc6654a068 100644 --- a/packages/shared-components/src/room-list/RoomListPrimaryFilters/RoomListPrimaryFilters.tsx +++ b/packages/shared-components/src/room-list/RoomListPrimaryFilters/RoomListPrimaryFilters.tsx @@ -96,9 +96,9 @@ export const RoomListPrimaryFilters = memo(function RoomListPrimaryFilters({ className={styles.list} ref={ref} > - {visibleFilterIds.map((filterId, index) => ( + {visibleFilterIds.map((filterId) => ( onToggleFilter(filterId)}