Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix

Manav Rathie668c8618532
diff --git a/web/apps/photos/eslint.config.mjs b/web/apps/photos/eslint.config.mjs
index 1cd39b9d11..5ca76ecd4d 100644
--- a/web/apps/photos/eslint.config.mjs
+++ b/web/apps/photos/eslint.config.mjs
@@ -49,6 +49,12 @@ export default [
"react-hooks/exhaustive-deps": "off",
"react-hooks/rules-of-hooks": "off",
"react-refresh/only-export-components": "off",
+ /** TODO: New during eslint 8=>9 migration */
+ "@typescript-eslint/no-unused-expressions": "off",
+ // "@typescript-eslint/no-unused-vars": "off",
+ "@typescript-eslint/return-await": "off",
+ "@typescript-eslint/prefer-regexp-exec": "off",
+ "@typescript-eslint/no-require-imports": "off",
},
},
];
diff --git a/web/apps/photos/src/components/Collections/CollectionNamer.tsx b/web/apps/photos/src/components/Collections/CollectionNamer.tsx
index bf64267499..c9429801ba 100644
--- a/web/apps/photos/src/components/Collections/CollectionNamer.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionNamer.tsx
@@ -1,4 +1,5 @@
import { TitledMiniDialog } from "@/base/components/MiniDialog";
+import log from "@/base/log";
import SingleInputForm, {
type SingleInputFormProps,
} from "@ente/shared/components/SingleInputForm";
@@ -34,6 +35,7 @@ export default function CollectionNamer({ attributes, ...props }: Props) {
attributes.callback(albumName);
props.onHide();
} catch (e) {
+ log.error(e);
setFieldError(t("generic_error_retry"));
}
};
diff --git a/web/apps/photos/src/components/DeleteAccountModal.tsx b/web/apps/photos/src/components/DeleteAccountModal.tsx
index 63dcd4d6a3..3af2eb1c26 100644
--- a/web/apps/photos/src/components/DeleteAccountModal.tsx
+++ b/web/apps/photos/src/components/DeleteAccountModal.tsx
@@ -144,7 +144,7 @@ const DeleteAccountModal = ({ open, onClose }: Iprops) => {
errors,
handleChange,
handleSubmit,
- }): JSX.Element => (
+ }): React.JSX.Element => (
<form noValidate onSubmit={handleSubmit}>
<Stack spacing={"24px"}>
<DropdownInput
diff --git a/web/apps/photos/src/components/ItemList.tsx b/web/apps/photos/src/components/ItemList.tsx
index 613bf58c3c..6da4d6dde3 100644
--- a/web/apps/photos/src/components/ItemList.tsx
+++ b/web/apps/photos/src/components/ItemList.tsx
@@ -12,19 +12,19 @@ export interface ItemListProps<T> {
items: T[];
generateItemKey: (item: T) => string | number;
getItemTitle: (item: T) => string;
- renderListItem: (item: T) => JSX.Element;
+ renderListItem: (item: T) => React.JSX.Element;
maxHeight?: number;
itemSize?: number;
}
interface ItemData<T> {
- renderListItem: (item: T) => JSX.Element;
+ renderListItem: (item: T) => React.JSX.Element;
getItemTitle: (item: T) => string;
items: T[];
}
const createItemData: <T>(
- renderListItem: (item: T) => JSX.Element,
+ renderListItem: (item: T) => React.JSX.Element,
getItemTitle: (item: T) => string,
items: T[],
) => ItemData<T> = memoize((renderListItem, getItemTitle, items) => ({
diff --git a/web/apps/photos/src/components/PhotoList/dedupe.tsx b/web/apps/photos/src/components/PhotoList/dedupe.tsx
index 6cc550f43e..46a0b53bf5 100644
--- a/web/apps/photos/src/components/PhotoList/dedupe.tsx
+++ b/web/apps/photos/src/components/PhotoList/dedupe.tsx
@@ -147,7 +147,7 @@ interface Props {
file: EnteFile,
index: number,
isScrolling?: boolean,
- ) => JSX.Element;
+ ) => React.JSX.Element;
activeCollectionID: number;
}
@@ -158,7 +158,7 @@ interface ItemData {
renderListItem: (
timeStampListItem: TimeStampListItem,
isScrolling?: boolean,
- ) => JSX.Element;
+ ) => React.JSX.Element;
}
const createItemData = memoize(
@@ -169,7 +169,7 @@ const createItemData = memoize(
renderListItem: (
timeStampListItem: TimeStampListItem,
isScrolling?: boolean,
- ) => JSX.Element,
+ ) => React.JSX.Element,
): ItemData => ({
timeStampList,
columns,
diff --git a/web/apps/photos/src/components/PhotoList/index.tsx b/web/apps/photos/src/components/PhotoList/index.tsx
index cdb55fa85c..27dfcda6d9 100644
--- a/web/apps/photos/src/components/PhotoList/index.tsx
+++ b/web/apps/photos/src/components/PhotoList/index.tsx
@@ -197,7 +197,7 @@ type Props = Pick<PhotoFrameProps, "mode" | "modePlus"> & {
file: EnteFile,
index: number,
isScrolling?: boolean,
- ) => JSX.Element;
+ ) => React.JSX.Element;
activeCollectionID: number;
activePersonID?: string;
};
@@ -209,7 +209,7 @@ interface ItemData {
renderListItem: (
timeStampListItem: TimeStampListItem,
isScrolling?: boolean,
- ) => JSX.Element;
+ ) => React.JSX.Element;
}
const createItemData = memoize(
@@ -220,7 +220,7 @@ const createItemData = memoize(
renderListItem: (
timeStampListItem: TimeStampListItem,
isScrolling?: boolean,
- ) => JSX.Element,
+ ) => React.JSX.Element,
): ItemData => ({
timeStampList,
columns,
diff --git a/web/apps/photos/src/components/PhotoViewer/FileInfo/FileNameEditDialog.tsx b/web/apps/photos/src/components/PhotoViewer/FileInfo/FileNameEditDialog.tsx
index 8dbc28dedd..578a80172c 100644
--- a/web/apps/photos/src/components/PhotoViewer/FileInfo/FileNameEditDialog.tsx
+++ b/web/apps/photos/src/components/PhotoViewer/FileInfo/FileNameEditDialog.tsx
@@ -1,4 +1,5 @@
import { TitledMiniDialog } from "@/base/components/MiniDialog";
+import log from "@/base/log";
import { photosDialogZIndex } from "@/new/photos/components/utils/z-index";
import SingleInputForm, {
type SingleInputFormProps,
@@ -20,6 +21,7 @@ export const FileNameEditDialog = ({
await saveEdits(filename);
closeEditMode();
} catch (e) {
+ log.error(e);
setFieldError(t("generic_error_retry"));
}
};
diff --git a/web/apps/photos/src/components/PhotoViewer/index.tsx b/web/apps/photos/src/components/PhotoViewer/index.tsx
index 0c8d6c9a41..beff8d012b 100644
--- a/web/apps/photos/src/components/PhotoViewer/index.tsx
+++ b/web/apps/photos/src/components/PhotoViewer/index.tsx
@@ -426,6 +426,7 @@ function PhotoViewer(props: PhotoViewerProps) {
if (ele) {
const rect = ele.getBoundingClientRect();
const pageYScroll =
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
window.pageYOffset ||
document.documentElement.scrollTop;
return {
@@ -435,7 +436,7 @@ function PhotoViewer(props: PhotoViewerProps) {
};
}
return null;
- } catch (e) {
+ } catch {
return null;
}
},
@@ -694,7 +695,7 @@ function PhotoViewer(props: PhotoViewerProps) {
file.metadata.title,
);
await downloadSingleFile(file, setSingleFileDownloadProgress);
- } catch (e) {
+ } catch {
// do nothing
}
}
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index c74fb6d1bc..19428b1563 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -327,7 +327,7 @@ export default function Gallery() {
try {
await getRecoveryKey();
return true;
- } catch (e) {
+ } catch {
logout();
return false;
}
diff --git a/web/apps/photos/src/services/collectionService.ts b/web/apps/photos/src/services/collectionService.ts
index ac8e02f5d5..a4eda9232c 100644
--- a/web/apps/photos/src/services/collectionService.ts
+++ b/web/apps/photos/src/services/collectionService.ts
@@ -1005,6 +1005,8 @@ export const sortCollectionSummaries = (
return (b.updationTime ?? 0) - (a.updationTime ?? 0);
}
})
+ // TODO:
+ // eslint-disable-next-line no-constant-binary-expression
.sort((a, b) => b.order ?? 0 - a.order ?? 0)
.sort(
(a, b) =>
diff --git a/web/apps/photos/src/services/export/index.ts b/web/apps/photos/src/services/export/index.ts
index 27a28d456e..c68593eff3 100644
--- a/web/apps/photos/src/services/export/index.ts
+++ b/web/apps/photos/src/services/export/index.ts
@@ -1407,7 +1407,7 @@ export const isLivePhotoExportName = (exportName: string) => {
try {
JSON.parse(exportName);
return true;
- } catch (e) {
+ } catch {
return false;
}
};
diff --git a/web/apps/photos/src/types/Notification/index.tsx b/web/apps/photos/src/types/Notification/index.tsx
index b38fff9537..6883c6bb92 100644
--- a/web/apps/photos/src/types/Notification/index.tsx
+++ b/web/apps/photos/src/types/Notification/index.tsx
@@ -8,8 +8,8 @@ export type NotificationAttributes =
interface MessageSubTextNotificationAttributes {
startIcon?: ReactNode;
variant: ButtonProps["color"];
- message?: JSX.Element | string;
- subtext?: JSX.Element | string;
+ message?: React.JSX.Element | string;
+ subtext?: React.JSX.Element | string;
title?: never;
caption?: never;
onClick: () => void;
@@ -19,8 +19,8 @@ interface MessageSubTextNotificationAttributes {
interface TitleCaptionNotificationAttributes {
startIcon?: ReactNode;
variant: ButtonProps["color"];
- title?: JSX.Element | string;
- caption?: JSX.Element | string;
+ title?: React.JSX.Element | string;
+ caption?: React.JSX.Element | string;
message?: never;
subtext?: never;
onClick: () => void;