π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
es
Manav Rathi6e025945ae90
diff --git a/web/apps/photos/eslint.config.mjs b/web/apps/photos/eslint.config.mjsindex 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.tsxindex 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-assignmentconst obj = JSON.parse(data);+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignmentconst code = obj.code;if (code) {diff --git a/web/apps/photos/src/components/Collections/AllAlbums.tsx b/web/apps/photos/src/components/Collections/AllAlbums.tsxindex 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-assignmentcollectionRowList,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignmentonCollectionClick,}));@@ -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) => (<AlbumCardisScrolling={isScrolling}onCollectionClick={onCollectionClick}diff --git a/web/apps/photos/src/components/UploadProgress.tsx b/web/apps/photos/src/components/UploadProgress.tsxindex 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 typesconst 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 typesconst 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-assignmentrenderListItem,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignmentgetItemTitle,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignmentitems,}));diff --git a/web/apps/photos/src/services/upload-manager.ts b/web/apps/photos/src/services/upload-manager.tsindex 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-assignmentprivate 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-assignmentthis.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-assignmentconst heapSize = (performance as any).memory.totalJSHeapSize;+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignmentconst 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.tsindex 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-callsetRangeStart(index);} else {+ // eslint-disable-next-line @typescript-eslint/no-unsafe-callsetRangeStart(undefined);}}diff --git a/web/apps/photos/tests/upload.test.ts b/web/apps/photos/tests/upload.test.tsindex 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 */