From 5db4db1d95c56f1785ac76f369a3fbd003c9681d Mon Sep 17 00:00:00 2001 From: Lotus Bot Date: Fri, 22 May 2026 19:52:23 -0400 Subject: [PATCH] fix: ESLint errors, stale disable comments, bundle splitting - RoomTimeline.tsx: add eslint-disable comment for intentional eventsLength dep on timelineSegments useMemo (needed to detect in-place timeline mutations) - Remove ~47 stale eslint-disable-next-line comments across 28 files for rules that are now off in the flat config (no-param-reassign, jsx-a11y/media-has-caption, react/no-array-index-key, etc); run prettier to reformat - vite.config.js: move manualChunks from rollupOptions.output to rolldownOptions.output so Rolldown (Vite 8) actually applies it; main bundle drops from 3.5 MB to 814 kB gzip-248 kB, matrix-sdk gets its own 1.16 MB cacheable chunk Co-Authored-By: Claude Sonnet 4.6 --- src/app/components/CallEmbedProvider.tsx | 1 - src/app/components/DeviceVerification.tsx | 1 - src/app/components/LobbySkeleton.tsx | 1 - src/app/components/Pdf-viewer/PdfViewer.tsx | 2 - src/app/components/RoomSkeleton.tsx | 2 - src/app/components/editor/Editor.tsx | 1 - src/app/components/editor/input.ts | 1 - src/app/components/editor/utils.ts | 2 - .../components/image-viewer/ImageViewer.tsx | 1 - src/app/components/media/Video.tsx | 1 - .../message/content/AudioContent.tsx | 1 - src/app/components/text-viewer/TextViewer.tsx | 1 - .../upload-card/UploadCardRenderer.tsx | 1 - src/app/features/call/CallControls.tsx | 1 - .../permissions/PermissionGroups.tsx | 1 - .../common-settings/permissions/Powers.tsx | 1 - .../message-search/SearchResultGroup.tsx | 1 - src/app/features/room/RoomInput.tsx | 1 - src/app/features/room/RoomTimeline.tsx | 2 +- .../room/room-pin-menu/RoomPinMenu.tsx | 1 - src/app/hooks/useForceUpdate.js | 1 - src/app/hooks/usePowerLevels.ts | 17 +++---- src/app/hooks/useRoomLatestRenderedEvent.ts | 1 - src/app/pages/client/ClientNonUIFeatures.tsx | 2 - src/app/pages/client/inbox/Notifications.tsx | 1 - src/app/plugins/call/CallControl.ts | 1 - src/app/plugins/call/CallWidgetDriver.ts | 3 +- src/app/plugins/react-custom-html-parser.tsx | 1 - src/util/cryptE2ERoomKeys.js | 2 +- vite.config.js | 51 ++++++++++--------- 30 files changed, 38 insertions(+), 66 deletions(-) diff --git a/src/app/components/CallEmbedProvider.tsx b/src/app/components/CallEmbedProvider.tsx index 4fbaf9616..5651b60e3 100644 --- a/src/app/components/CallEmbedProvider.tsx +++ b/src/app/components/CallEmbedProvider.tsx @@ -1,4 +1,3 @@ -/* eslint-disable jsx-a11y/media-has-caption */ import React, { ReactNode, useCallback, useEffect, useRef, useState } from 'react'; import { useAtomValue, useSetAtom } from 'jotai'; import FocusTrap from 'focus-trap-react'; diff --git a/src/app/components/DeviceVerification.tsx b/src/app/components/DeviceVerification.tsx index 4bdba9adb..02811a856 100644 --- a/src/app/components/DeviceVerification.tsx +++ b/src/app/components/DeviceVerification.tsx @@ -137,7 +137,6 @@ function CompareEmoji({ sasData }: { sasData: ShowSasCallbacks }) { > {sasData.sas.emoji?.map(([emoji, name], index) => ( {ROOM_ROWS.map((row, i) => ( - // eslint-disable-next-line react/no-array-index-key
{MESSAGES.map((msg, i) => ( - // eslint-disable-next-line react/no-array-index-key
)} {msg.lines.map((line, j) => ( - // eslint-disable-next-line react/no-array-index-key
))}
diff --git a/src/app/components/editor/Editor.tsx b/src/app/components/editor/Editor.tsx index bbc2889e7..0a32eaf8b 100644 --- a/src/app/components/editor/Editor.tsx +++ b/src/app/components/editor/Editor.tsx @@ -1,4 +1,3 @@ -/* eslint-disable no-param-reassign */ import React, { ClipboardEventHandler, KeyboardEventHandler, diff --git a/src/app/components/editor/input.ts b/src/app/components/editor/input.ts index 70f1a1368..6a0d5889e 100644 --- a/src/app/components/editor/input.ts +++ b/src/app/components/editor/input.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-param-reassign */ import { Descendant, Text } from 'slate'; import parse from 'html-dom-parser'; import { ChildNode, Element, isText, isTag } from 'domhandler'; diff --git a/src/app/components/editor/utils.ts b/src/app/components/editor/utils.ts index 512d50f6b..cf3b5e410 100644 --- a/src/app/components/editor/utils.ts +++ b/src/app/components/editor/utils.ts @@ -148,7 +148,6 @@ export const resetEditor = (editor: Editor) => { }; export const resetEditorHistory = (editor: Editor) => { - // eslint-disable-next-line no-param-reassign editor.history = { undos: [], redos: [], @@ -228,7 +227,6 @@ export const getPointUntilChar = ( reverse: options.reverse, }); - // eslint-disable-next-line no-restricted-syntax for (const point of pointItr) { if (!Point.equals(point, cursorPoint) && prevPoint) { char = Editor.string(editor, { anchor: point, focus: prevPoint }); diff --git a/src/app/components/image-viewer/ImageViewer.tsx b/src/app/components/image-viewer/ImageViewer.tsx index 582e17e32..909751ef7 100644 --- a/src/app/components/image-viewer/ImageViewer.tsx +++ b/src/app/components/image-viewer/ImageViewer.tsx @@ -1,4 +1,3 @@ -/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ import React from 'react'; import FileSaver from 'file-saver'; import classNames from 'classnames'; diff --git a/src/app/components/media/Video.tsx b/src/app/components/media/Video.tsx index 7360f23fb..fc8883275 100644 --- a/src/app/components/media/Video.tsx +++ b/src/app/components/media/Video.tsx @@ -4,7 +4,6 @@ import * as css from './media.css'; export const Video = forwardRef>( ({ className, ...props }, ref) => ( - // eslint-disable-next-line jsx-a11y/media-has-caption