From c506eec544c95f6ef281e9011dc6bbfe95d041b6 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Tue, 19 Nov 2024 19:38:42 +0530 Subject: [PATCH] Fix --- web/packages/new/eslint.config.mjs | 7 +++++++ .../new/photos/components/PhotoDateTimePicker.tsx | 2 +- web/packages/new/photos/services/magic-metadata.ts | 1 - web/packages/new/photos/services/user-entity/index.ts | 2 +- web/packages/new/photos/types/notification.tsx | 8 ++++---- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/web/packages/new/eslint.config.mjs b/web/packages/new/eslint.config.mjs index 0679b564ea..8b441fa3fe 100644 --- a/web/packages/new/eslint.config.mjs +++ b/web/packages/new/eslint.config.mjs @@ -9,4 +9,11 @@ export default [ // that possibly arise from it not being able to locate ffmpeg-wasm. ignores: ["**/ffmpeg/worker.ts"], }, + { + rules: { + /** TODO: New during eslint 8=>9 migration */ + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-unused-expressions": "off", + }, + }, ]; diff --git a/web/packages/new/photos/components/PhotoDateTimePicker.tsx b/web/packages/new/photos/components/PhotoDateTimePicker.tsx index b6e6ec4b93..b78a1140ad 100644 --- a/web/packages/new/photos/components/PhotoDateTimePicker.tsx +++ b/web/packages/new/photos/components/PhotoDateTimePicker.tsx @@ -151,7 +151,7 @@ const parseMetadataDateFromDayjs = (d: Dayjs): ParsedMetadataDate => { // Check to see if there is a time-zone descriptor of the form "Z" or // "±05:30" or "±0530" at the end of s. - const m = s.match(/Z|[+-]\d\d:?\d\d$/); + const m = /Z|[+-]\d\d:?\d\d$/.exec(s); if (m?.index) { dateTime = s.substring(0, m.index); offset = s.substring(m.index); diff --git a/web/packages/new/photos/services/magic-metadata.ts b/web/packages/new/photos/services/magic-metadata.ts index d7b78f8964..faf98a8bce 100644 --- a/web/packages/new/photos/services/magic-metadata.ts +++ b/web/packages/new/photos/services/magic-metadata.ts @@ -114,7 +114,6 @@ export const getNonEmptyMagicMetadataProps = (magicMetadataProps: T): T => { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore Object.entries(magicMetadataProps).filter( - // eslint-disable-next-line @typescript-eslint/no-unused-vars ([_, v]) => v !== null && v !== undefined, ), ) as T; diff --git a/web/packages/new/photos/services/user-entity/index.ts b/web/packages/new/photos/services/user-entity/index.ts index ad7fb76eb9..ea6dcb57e3 100644 --- a/web/packages/new/photos/services/user-entity/index.ts +++ b/web/packages/new/photos/services/user-entity/index.ts @@ -134,7 +134,7 @@ export const pullUserEntities = async ( const entityKeyB64 = await getOrCreateEntityKeyB64(type, masterKey); let sinceTime = (await savedLatestUpdatedAt(type)) ?? 0; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, no-constant-condition + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition while (true) { const diff = await userEntityDiff(type, sinceTime, entityKeyB64); if (diff.length == 0) break; diff --git a/web/packages/new/photos/types/notification.tsx b/web/packages/new/photos/types/notification.tsx index 43ea111911..b4080ce257 100644 --- a/web/packages/new/photos/types/notification.tsx +++ b/web/packages/new/photos/types/notification.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;