From 69b86415347d1af6558406365cc8e903e9d4182b Mon Sep 17 00:00:00 2001 From: Fares Rihani Date: Thu, 4 Nov 2021 06:43:03 -0400 Subject: [PATCH] [GH-1351] Webapp Linter Fixes - Investigate / Update using any Record (#1682) * Webapp Linter Fixes - update workspace.ts, dateRange.tsx, editableDatePicker.tsx * Webapp Linter Fixes - accept Record in block.ts, user.tsx * Webapp Linter Fixes - Cleanup moment global-require * Webapp Linter Fixes - match settings type to backend in workspace.ts Co-authored-by: Mattermod --- webapp/src/blocks/block.ts | 2 ++ webapp/src/blocks/workspace.ts | 1 + webapp/src/components/properties/dateRange/dateRange.tsx | 5 ++--- webapp/src/user.tsx | 1 + webapp/src/widgets/editableDayPicker.tsx | 4 ++-- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/webapp/src/blocks/block.ts b/webapp/src/blocks/block.ts index 3ad35c756..258377e0c 100644 --- a/webapp/src/blocks/block.ts +++ b/webapp/src/blocks/block.ts @@ -15,6 +15,7 @@ interface BlockPatch { schema?: number type?: BlockTypes title?: string + // eslint-disable-next-line @typescript-eslint/no-explicit-any updatedFields?: Record deletedFields?: string[] deleteAt?: number @@ -31,6 +32,7 @@ interface Block { schema: number type: BlockTypes title: string + // eslint-disable-next-line @typescript-eslint/no-explicit-any fields: Record createAt: number diff --git a/webapp/src/blocks/workspace.ts b/webapp/src/blocks/workspace.ts index 3a7112f81..c83d995ba 100644 --- a/webapp/src/blocks/workspace.ts +++ b/webapp/src/blocks/workspace.ts @@ -4,6 +4,7 @@ interface IWorkspace { readonly id: string, readonly title: string, readonly signupToken: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any readonly settings: Readonly> readonly modifiedBy?: string, readonly updateAt?: number, diff --git a/webapp/src/components/properties/dateRange/dateRange.tsx b/webapp/src/components/properties/dateRange/dateRange.tsx index b632f8951..541c2f7c1 100644 --- a/webapp/src/components/properties/dateRange/dateRange.tsx +++ b/webapp/src/components/properties/dateRange/dateRange.tsx @@ -33,7 +33,7 @@ export type DateProperty = { timeZone?: string } -const loadedLocales: Record = {} +const loadedLocales: Record = {} function DateRange(props: Props): JSX.Element { const {className, value, showEmptyPlaceholder, onChange} = props @@ -80,9 +80,8 @@ function DateRange(props: Props): JSX.Element { const locale = intl.locale.toLowerCase() if (locale && locale !== 'en' && !loadedLocales[locale]) { - /* eslint-disable global-require */ + // eslint-disable-next-line global-require loadedLocales[locale] = require(`moment/locale/${locale}`) - /* eslint-disable global-require */ } const handleDayClick = (day: Date) => { diff --git a/webapp/src/user.tsx b/webapp/src/user.tsx index c5b0a5d55..88191a337 100644 --- a/webapp/src/user.tsx +++ b/webapp/src/user.tsx @@ -5,6 +5,7 @@ interface IUser { id: string, username: string, email: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any props: Record, createAt: number, updateAt: number, diff --git a/webapp/src/widgets/editableDayPicker.tsx b/webapp/src/widgets/editableDayPicker.tsx index 661f60357..190ea9e11 100644 --- a/webapp/src/widgets/editableDayPicker.tsx +++ b/webapp/src/widgets/editableDayPicker.tsx @@ -16,11 +16,11 @@ type Props = { onChange: (value: string | undefined) => void } -const loadedLocales: Record = {} +const loadedLocales: Record = {} const updateLocales = (locale: string) => { if (locale && locale !== 'en' && !loadedLocales[locale]) { - /* eslint-disable global-require */ + // eslint-disable-next-line global-require loadedLocales[locale] = require(`moment/locale/${locale}`) } }