[GH-1351] Webapp Linter Fixes - Investigate / Update using any Record<string, any> (#1682)

* Webapp Linter Fixes - update workspace.ts, dateRange.tsx, editableDatePicker.tsx

* Webapp Linter Fixes - accept Record<string, any> 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 <mattermod@users.noreply.github.com>
This commit is contained in:
Fares Rihani 2021-11-04 06:43:03 -04:00 committed by GitHub
parent 751f632c36
commit 69b8641534
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 5 deletions

View file

@ -15,6 +15,7 @@ interface BlockPatch {
schema?: number
type?: BlockTypes
title?: string
// eslint-disable-next-line @typescript-eslint/no-explicit-any
updatedFields?: Record<string, any>
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<string, any>
createAt: number

View file

@ -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<Record<string, any>>
readonly modifiedBy?: string,
readonly updateAt?: number,

View file

@ -33,7 +33,7 @@ export type DateProperty = {
timeZone?: string
}
const loadedLocales: Record<string, any> = {}
const loadedLocales: Record<string, moment.Locale> = {}
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) => {

View file

@ -5,6 +5,7 @@ interface IUser {
id: string,
username: string,
email: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
props: Record<string, any>,
createAt: number,
updateAt: number,

View file

@ -16,11 +16,11 @@ type Props = {
onChange: (value: string | undefined) => void
}
const loadedLocales: Record<string, any> = {}
const loadedLocales: Record<string, moment.Locale> = {}
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}`)
}
}