Skip to content

armgit / ente

Public Imported from GitHub
0

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

es

Manav Rathi6e025945ae90
diff --git a/web/apps/photos/eslint.config.mjs b/web/apps/photos/eslint.config.mjs
index 76d9b9a84c..55cdf1eea7 100644
--- a/web/apps/photos/eslint.config.mjs
+++ b/web/apps/photos/eslint.config.mjs
@@ -11,12 +11,9 @@ export default [
*/
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
"@typescript-eslint/no-unnecessary-condition": "off",
- "@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
- "@typescript-eslint/no-unsafe-argument": "off",
- "@typescript-eslint/no-unsafe-call": "off",
/** TODO: Disabled as we migrate, try to prune these again */
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
diff --git a/web/apps/photos/src/components/Collections/AlbumCastDialog.tsx b/web/apps/photos/src/components/Collections/AlbumCastDialog.tsx
index 915fb693fb..9e255bdab5 100644
--- a/web/apps/photos/src/components/Collections/AlbumCastDialog.tsx
+++ b/web/apps/photos/src/components/Collections/AlbumCastDialog.tsx
@@ -128,7 +128,10 @@ export const AlbumCastDialogContents: React.FC<AlbumCastDialogProps> = ({
"urn:x-cast:pair-request",
(_, message) => {
const data = message;
+ // TODO:
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const obj = JSON.parse(data);
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const code = obj.code;
if (code) {
diff --git a/web/apps/photos/src/components/Collections/AllAlbums.tsx b/web/apps/photos/src/components/Collections/AllAlbums.tsx
index be7f7e7921..f7d54286ca 100644
--- a/web/apps/photos/src/components/Collections/AllAlbums.tsx
+++ b/web/apps/photos/src/components/Collections/AllAlbums.tsx
@@ -162,7 +162,10 @@ interface ItemData {
// If we were only passing a single, stable value (e.g. items),
// We could just pass the value directly.
const createItemData = memoize((collectionRowList, onCollectionClick) => ({
+ // TODO:
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
collectionRowList,
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
onCollectionClick,
}));
@@ -182,7 +185,7 @@ const AlbumsRow = React.memo(
return (
<div style={style}>
<Stack direction="row" sx={{ p: 2, gap: 0.5 }}>
- {collectionRow.map((item: any) => (
+ {collectionRow.map((item) => (
<AlbumCard
isScrolling={isScrolling}
onCollectionClick={onCollectionClick}
diff --git a/web/apps/photos/src/components/UploadProgress.tsx b/web/apps/photos/src/components/UploadProgress.tsx
index 29a4c436ab..e8a4355ac3 100644
--- a/web/apps/photos/src/components/UploadProgress.tsx
+++ b/web/apps/photos/src/components/UploadProgress.tsx
@@ -1,4 +1,5 @@
// TODO: Audit this file
+/* eslint-disable @typescript-eslint/no-unsafe-argument */
import CloseIcon from "@mui/icons-material/Close";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import UnfoldLessIcon from "@mui/icons-material/UnfoldLess";
@@ -384,6 +385,7 @@ const InProgressSection: React.FC = () => {
// @ts-expect-error Need to add types
const renderListItem = ({ localFileID, progress }) => {
return (
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
<InProgressItemContainer key={localFileID}>
<span>{uploadFileNames.get(localFileID)}</span>
{uploadPhase == "uploading" && (
@@ -507,6 +509,7 @@ const ResultSection: React.FC<ResultSectionProps> = ({
// @ts-expect-error Need to add types
const renderListItem = (fileID) => {
return (
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
<ResultItemContainer key={fileID}>
{uploadFileNames.get(fileID)}
</ResultItemContainer>
@@ -595,8 +598,12 @@ const createItemData: <T>(
getItemTitle: (item: T) => string,
items: T[],
) => ItemData<T> = memoize((renderListItem, getItemTitle, items) => ({
+ // TODO
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
renderListItem,
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
getItemTitle,
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
items,
}));
diff --git a/web/apps/photos/src/services/upload-manager.ts b/web/apps/photos/src/services/upload-manager.ts
index 07ed999501..7df566064a 100644
--- a/web/apps/photos/src/services/upload-manager.ts
+++ b/web/apps/photos/src/services/upload-manager.ts
@@ -235,8 +235,7 @@ class UIService {
}
}
-// @ts-expect-error Need to add types
-function convertInProgressUploadsToList(inProgressUploads) {
+function convertInProgressUploadsToList(inProgressUploads: InProgressUploads) {
return [...inProgressUploads.entries()].map(
([localFileID, progress]) =>
({ localFileID, progress }) as InProgressUpload,
@@ -253,6 +252,7 @@ const groupByResult = (finishedUploads: FinishedUploads) => {
};
class UploadManager {
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
private comlinkCryptoWorkers: ComlinkWorker<typeof CryptoWorker>[] =
new Array(maxConcurrentUploads);
private parsedMetadataJSONMap = new Map<string, ParsedMetadataJSON>();
@@ -298,6 +298,7 @@ class UploadManager {
) {
this.itemsToBeUploaded = [];
this.failedItems = [];
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
this.parsedMetadataJSONMap = parsedMetadataJSONMap ?? new Map();
this.uploaderName = undefined;
this.shouldUploadBeCancelled = false;
@@ -775,7 +776,9 @@ const logAboutMemoryPressureIfNeeded = () => {
// is the method recommended by the Electron team (see the link about the V8
// memory cage). The embedded Chromium supports it fine though, we just need
// to goad TypeScript to accept the type.
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const heapSize = (performance as any).memory.totalJSHeapSize;
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const heapLimit = (performance as any).memory.jsHeapSizeLimit;
if (heapSize / heapLimit > 0.7) {
log.info(
diff --git a/web/apps/photos/src/utils/photoFrame/index.ts b/web/apps/photos/src/utils/photoFrame/index.ts
index e5a73dde20..c32a382df1 100644
--- a/web/apps/photos/src/utils/photoFrame/index.ts
+++ b/web/apps/photos/src/utils/photoFrame/index.ts
@@ -18,8 +18,10 @@ export const handleSelectCreator =
(checked: boolean) => {
if (typeof index != "undefined") {
if (checked) {
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
setRangeStart(index);
} else {
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
setRangeStart(undefined);
}
}
diff --git a/web/apps/photos/tests/upload.test.ts b/web/apps/photos/tests/upload.test.ts
index 7f1bbcfd7e..87bc447531 100644
--- a/web/apps/photos/tests/upload.test.ts
+++ b/web/apps/photos/tests/upload.test.ts
@@ -1,4 +1,7 @@
// TODO: Audit this file
+/* eslint-disable @typescript-eslint/no-unsafe-call */
+/* eslint-disable @typescript-eslint/no-unsafe-assignment */
+/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-base-to-string */
/* eslint-disable @typescript-eslint/restrict-template-expressions */