refactor(types): drop 127 unnecessary as any casts (#210)

Removed every `as any` in src/, then restored only the ones tsc still
needs: 163 → 36. 112 were in lotus-terminal.css.ts (`'… !important' as
any` etc. — vanilla-extract's style types accept these strings as-is),
so its file-wide eslint-disable goes too. The casts were type-only, so
emitted code and generated CSS are unchanged.

eslint warnings 49 → 46; the ratchet is tightened to match.
tsc clean; 1202 unit tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
Lotus CI
2026-09-23 23:32:42 -04:00
co-authored by Claude Opus 5.5
parent 4a9823890b
commit f3722ae859
9 changed files with 127 additions and 142 deletions
+1 -1
View File
@@ -330,7 +330,7 @@ function AddSpaceButton({ item }: { item: HierarchyItem }) {
};
const handleCreateSpace = () => {
openCreateSpaceModal(item.roomId as any);
openCreateSpaceModal(item.roomId);
setCords(undefined);
};
@@ -174,8 +174,7 @@ export const useMessageSearch = (params: MessageSearchParams) => {
// date range is instead enforced client-side (see filterGroupsByDateRange).
// contains_url is a valid spec field not yet in SDK types.
...(containsUrl !== undefined && { contains_url: containsUrl }),
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any,
},
include_state: false,
order_by: order as SearchOrderBy.Recent,
search_term: term,
@@ -361,12 +361,9 @@ export function ForwardMessageDialog({ mEvent, onClose }: Props) {
// failed) doesn't post the comment twice — only the missing forward.
const needsComment = commentBody && !commentSentRef.current.has(id);
const step = needsComment
? mx
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.sendMessage(id, null, { msgtype: MsgType.Text, body: commentBody } as any)
.then(() => {
commentSentRef.current.add(id);
})
? mx.sendMessage(id, null, { msgtype: MsgType.Text, body: commentBody }).then(() => {
commentSentRef.current.add(id);
})
: Promise.resolve();
return step.then(sendForward);
};
+2 -4
View File
@@ -1283,8 +1283,7 @@ export const Message = React.memo(
after={<Icon size="100" src={Icons.Send} />}
radii="300"
onClick={() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(mx as any).resendEvent(mEvent, room);
mx.resendEvent(mEvent, room);
closeMenu();
}}
>
@@ -1297,8 +1296,7 @@ export const Message = React.memo(
after={<Icon size="100" src={Icons.Cross} />}
radii="300"
onClick={() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(mx as any).cancelPendingEvent(mEvent);
mx.cancelPendingEvent(mEvent);
closeMenu();
}}
>