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:
@@ -64,12 +64,12 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
|
||||
useCallback(
|
||||
(pickedFiles: File[]) => {
|
||||
const uniqueFiles = pickedFiles.map((file) => {
|
||||
const fileName = replaceSpaceWithDash(file.name);
|
||||
const fileName = replaceSpaceWithDash((file as File).name);
|
||||
if (hasImageWithShortcode(fileName)) {
|
||||
const uniqueName = suffixRename(fileName, hasImageWithShortcode);
|
||||
return renameFile(file, uniqueName);
|
||||
}
|
||||
return fileName !== file.name ? renameFile(file, fileName) : file;
|
||||
return fileName !== (file as File).name ? renameFile(file, fileName) : file;
|
||||
});
|
||||
|
||||
setFiles((f) => [...f, ...uniqueFiles]);
|
||||
@@ -122,7 +122,7 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
|
||||
info: getImageInfo(imgEl, data.file),
|
||||
};
|
||||
const image = PackImageReader.fromPackImage(
|
||||
getFileNameWithoutExt(data.file.name),
|
||||
getFileNameWithoutExt((data.file as File).name),
|
||||
packImage,
|
||||
);
|
||||
if (!image) return;
|
||||
@@ -361,7 +361,7 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
|
||||
)}
|
||||
{files.map((file) => (
|
||||
<SequenceCard
|
||||
key={file.name}
|
||||
key={(file as File).name}
|
||||
style={{ padding: config.space.S300 }}
|
||||
variant="SurfaceVariant"
|
||||
direction="Column"
|
||||
|
||||
@@ -22,7 +22,10 @@ export function RoomImagePack({ room, stateKey }: RoomImagePackProps) {
|
||||
const creators = useRoomCreators(room);
|
||||
|
||||
const permissions = useRoomPermissions(creators, powerLevels);
|
||||
const canEditImagePack = permissions.stateEvent(StateEvent.PoniesRoomEmotes, userId);
|
||||
const canEditImagePack = permissions.stateEvent(
|
||||
StateEvent.PoniesRoomEmotes as unknown as keyof import('matrix-js-sdk').StateEvents,
|
||||
userId,
|
||||
);
|
||||
|
||||
const fallbackPack = useMemo(() => {
|
||||
const fakePackId = randomStr(4);
|
||||
@@ -44,8 +47,8 @@ export function RoomImagePack({ room, stateKey }: RoomImagePackProps) {
|
||||
|
||||
await mx.sendStateEvent(
|
||||
address.roomId,
|
||||
StateEvent.PoniesRoomEmotes,
|
||||
packContent,
|
||||
StateEvent.PoniesRoomEmotes as unknown as keyof import('matrix-js-sdk').StateEvents,
|
||||
packContent as any,
|
||||
address.stateKey,
|
||||
);
|
||||
},
|
||||
|
||||
@@ -13,7 +13,10 @@ export function UserImagePack() {
|
||||
|
||||
const handleUpdate = useCallback(
|
||||
async (packContent: PackContent) => {
|
||||
await mx.setAccountData(AccountDataEvent.PoniesUserEmotes, packContent);
|
||||
await mx.setAccountData(
|
||||
AccountDataEvent.PoniesUserEmotes as unknown as keyof import('matrix-js-sdk').AccountDataEvents,
|
||||
packContent,
|
||||
);
|
||||
},
|
||||
[mx],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user