Skip to content

armgit / ente

Public Imported from GitHub
0

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

lint

Manav Rathi6221f904e4e3
diff --git a/web/apps/photos/eslint.config.mjs b/web/apps/photos/eslint.config.mjs
index 8765bfa62e..d17d12eed0 100644
--- a/web/apps/photos/eslint.config.mjs
+++ b/web/apps/photos/eslint.config.mjs
@@ -10,7 +10,6 @@ export default [
* turned on to function correctly"
*/
"@typescript-eslint/no-unnecessary-condition": "off",
- "@typescript-eslint/no-explicit-any": "off",
/** TODO: Disabled as we migrate, try to prune these again */
"@typescript-eslint/no-floating-promises": "off",
"react-hooks/exhaustive-deps": "off",
diff --git a/web/apps/photos/src/components/FileList.tsx b/web/apps/photos/src/components/FileList.tsx
index f75bb4da11..f8071fd598 100644
--- a/web/apps/photos/src/components/FileList.tsx
+++ b/web/apps/photos/src/components/FileList.tsx
@@ -75,6 +75,7 @@ interface TimeStampListItem {
date?: string | null;
dates?: { date: string; span: number }[];
groups?: number[];
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
item?: any;
id?: string;
height?: number;
diff --git a/web/apps/photos/src/services/upload-manager.ts b/web/apps/photos/src/services/upload-manager.ts
index f4ff2d8e1c..34680f1873 100644
--- a/web/apps/photos/src/services/upload-manager.ts
+++ b/web/apps/photos/src/services/upload-manager.ts
@@ -771,15 +771,19 @@ const clusterLivePhotos = async (
*/
const logAboutMemoryPressureIfNeeded = () => {
if (!globalThis.electron) return;
+
// performance.memory is deprecated in general as a Web standard, and is
// also not available in the DOM types provided by TypeScript. However, it
// 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, @typescript-eslint/no-unsafe-member-access
- const heapSize = (performance as any).memory.totalJSHeapSize;
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
- const heapLimit = (performance as any).memory.jsHeapSizeLimit;
+
+ const { memory } = performance as unknown as {
+ memory: { totalJSHeapSize: number; jsHeapSizeLimit: number };
+ };
+
+ const heapSize = memory.totalJSHeapSize;
+ const heapLimit = memory.jsHeapSizeLimit;
if (heapSize / heapLimit > 0.7) {
log.info(
`Memory usage (${heapSize} bytes of ${heapLimit} bytes) exceeds the high water mark`,