chore: upgrade TypeScript 4.9 to 5.9, ESLint 8.29 to 8.57, @typescript-eslint 5 to 7
Resolves all TS2345/TS2347/TS7006 type errors introduced by stricter TypeScript 5.x. Fix Icons.Settings to Icons.Setting, cast account data returns, fix implicit any. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import { MatrixEvent } from 'matrix-js-sdk';
|
||||
import { useState, useCallback } from 'react';
|
||||
import { useMatrixClient } from './useMatrixClient';
|
||||
import { useAccountDataCallback } from './useAccountDataCallback';
|
||||
|
||||
export function useAccountData(eventType: string) {
|
||||
export function useAccountData(eventType: string): MatrixEvent | undefined {
|
||||
const mx = useMatrixClient();
|
||||
const [event, setEvent] = useState(() => mx.getAccountData(eventType));
|
||||
const [event, setEvent] = useState<MatrixEvent | undefined>(
|
||||
() => (mx as any).getAccountData(eventType) as MatrixEvent | undefined,
|
||||
);
|
||||
|
||||
useAccountDataCallback(
|
||||
mx,
|
||||
|
||||
@@ -54,11 +54,11 @@ export function useRoomReadPositions(room: Room): Map<string, string[]> {
|
||||
};
|
||||
const onMembership = (): void => setPositions(computePositions(room, myUserId));
|
||||
room.on(RoomEvent.Receipt, onReceipt);
|
||||
room.on(RoomMemberEvent.Membership, onMembership);
|
||||
(room as any).on(RoomMemberEvent.Membership, onMembership);
|
||||
return () => {
|
||||
if (debounceTimer !== null) clearTimeout(debounceTimer);
|
||||
room.removeListener(RoomEvent.Receipt, onReceipt);
|
||||
room.removeListener(RoomMemberEvent.Membership, onMembership);
|
||||
(room as any).removeListener(RoomMemberEvent.Membership, onMembership);
|
||||
};
|
||||
}, [room, myUserId]);
|
||||
|
||||
|
||||
@@ -47,17 +47,17 @@ export const useRoomsNotificationPreferences = (): RoomsNotificationPreferences
|
||||
allMessages: new Set(),
|
||||
};
|
||||
|
||||
override.forEach((rule) => {
|
||||
override.forEach((rule: any) => {
|
||||
if (isRoomId(rule.rule_id) && getNotificationMode(rule.actions) === NotificationMode.OFF) {
|
||||
pref.mute.add(rule.rule_id);
|
||||
}
|
||||
});
|
||||
room.forEach((rule) => {
|
||||
room.forEach((rule: any) => {
|
||||
if (getNotificationMode(rule.actions) === NotificationMode.OFF) {
|
||||
pref.specialMessages.add(rule.rule_id);
|
||||
}
|
||||
});
|
||||
room.forEach((rule) => {
|
||||
room.forEach((rule: any) => {
|
||||
if (getNotificationMode(rule.actions) !== NotificationMode.OFF) {
|
||||
pref.allMessages.add(rule.rule_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user