diff --git a/src/components/designSystem/Skeleton.tsx b/src/components/designSystem/Skeleton.tsx index a7a239850..cfe8c102d 100644 --- a/src/components/designSystem/Skeleton.tsx +++ b/src/components/designSystem/Skeleton.tsx @@ -5,22 +5,12 @@ import { tw } from '~/styles/utils' import { AvatarSize, avatarSizeStyles, mapAvatarSize } from './Avatar' -enum SkeletonVariantEnum { - connectorAvatar = 'connectorAvatar', // squared with rounded corners - userAvatar = 'userAvatar', // rounded - text = 'text', - circular = 'circular', -} - -enum SkeletonColorEnum { - dark = 'dark', - light = 'light', -} +type SkeletonVariant = 'connectorAvatar' | 'userAvatar' | 'text' | 'circular' -type TSkeletonVariant = keyof typeof SkeletonVariantEnum +type SkeletonColor = 'dark' | 'light' interface SkeletonConnectorProps { - variant: Extract + variant: Extract size: AvatarSize /** * @deprecated Use `className` and TailwindCSS instead @@ -43,11 +33,11 @@ interface SkeletonConnectorProps { * @deprecated Use `className` and TailwindCSS instead */ marginTop?: number | string - color?: keyof typeof SkeletonColorEnum + color?: SkeletonColor } interface SkeletonGenericProps { - variant: Extract + variant: Extract /** * @deprecated Use `className` and TailwindCSS instead */ @@ -70,7 +60,7 @@ interface SkeletonGenericProps { * @deprecated Use `className` and TailwindCSS instead */ marginTop?: number | string - color?: keyof typeof SkeletonColorEnum + color?: SkeletonColor } const skeletonStyles = cva('w-full animate-pulse bg-grey-100', { diff --git a/src/components/form/JsonEditor/JsonEditor.tsx b/src/components/form/JsonEditor/JsonEditor.tsx index f0a7b3317..30f3758e2 100644 --- a/src/components/form/JsonEditor/JsonEditor.tsx +++ b/src/components/form/JsonEditor/JsonEditor.tsx @@ -79,7 +79,7 @@ export const JsonEditor = ({ if (typeof value === 'object') { try { setJsonQuery(JSON.stringify(value, null, 2)) - } catch (e) {} // Nothing is supposed to happen here + } catch {} // Nothing is supposed to happen here } else { setJsonQuery(value) } @@ -160,13 +160,13 @@ export const JsonEditor = ({ if (validate) { try { validate(jsonQuery) - } catch (e) { + } catch { onError && onError(JSON_EDITOR_ERROR_ENUM.invalidCustomValidate) } } else if (editorMode === 'json') { try { JSON.parse(jsonQuery) - } catch (e) { + } catch { onError && onError(JSON_EDITOR_ERROR_ENUM.invalid) } } diff --git a/src/components/settings/integrations/AddAnrokDialog.tsx b/src/components/settings/integrations/AddAnrokDialog.tsx index ebd825250..55a3e0e33 100644 --- a/src/components/settings/integrations/AddAnrokDialog.tsx +++ b/src/components/settings/integrations/AddAnrokDialog.tsx @@ -148,7 +148,7 @@ export const AddAnrokDialog = forwardRef((_, ref) => { }, context: { silentErrorCodes: [LagoApiError.UnprocessableEntity] }, }) - } catch (error) {} + } catch {} } const { errors } = res as diff --git a/src/components/settings/integrations/AddHubspotDialog.tsx b/src/components/settings/integrations/AddHubspotDialog.tsx index 59d2b72f0..c3f0d5f44 100644 --- a/src/components/settings/integrations/AddHubspotDialog.tsx +++ b/src/components/settings/integrations/AddHubspotDialog.tsx @@ -166,7 +166,7 @@ export const AddHubspotDialog = forwardRef((_, ref) => { return handleError(res.errors) } } - } catch (error) { + } catch { setShowGlobalError(true) return } diff --git a/src/components/settings/integrations/AddNetsuiteDialog.tsx b/src/components/settings/integrations/AddNetsuiteDialog.tsx index 7949fceb4..e96996939 100644 --- a/src/components/settings/integrations/AddNetsuiteDialog.tsx +++ b/src/components/settings/integrations/AddNetsuiteDialog.tsx @@ -195,7 +195,7 @@ export const AddNetsuiteDialog = forwardRef((_, ref) => { return handleError(res.errors) } } - } catch (error) { + } catch { setShowGlobalError(true) return } diff --git a/src/components/settings/integrations/AddXeroDialog.tsx b/src/components/settings/integrations/AddXeroDialog.tsx index 5fa0ac427..0df5ab2c4 100644 --- a/src/components/settings/integrations/AddXeroDialog.tsx +++ b/src/components/settings/integrations/AddXeroDialog.tsx @@ -167,7 +167,7 @@ export const AddXeroDialog = forwardRef((_, ref) => { return handleError(res.errors) } } - } catch (error) { + } catch { setShowGlobalError(true) return } diff --git a/src/core/apolloClient/cacheUtils.ts b/src/core/apolloClient/cacheUtils.ts index 30601e59b..a309e9cf6 100644 --- a/src/core/apolloClient/cacheUtils.ts +++ b/src/core/apolloClient/cacheUtils.ts @@ -1,5 +1,4 @@ -import { gql } from '@apollo/client' -import { ApolloClient } from '@apollo/client' +import { ApolloClient, gql } from '@apollo/client' import { CurrentUserFragment } from '~/generated/graphql' @@ -28,7 +27,7 @@ export const getItemFromLS = (key: string) => { try { return data === 'undefined' ? undefined : !!data ? JSON.parse(data) : data - } catch (err) { + } catch { return data } } diff --git a/src/core/translations/utils.ts b/src/core/translations/utils.ts index ca167d1d9..8ea6df7c5 100644 --- a/src/core/translations/utils.ts +++ b/src/core/translations/utils.ts @@ -10,7 +10,7 @@ export const getTranslations: (locale: Locale) => Promise // Translations are dinamically imported according to the selected locale try { loadedTranslation = (await import(`../../../translations/${locale}.json`)) as Translation - } catch (err) { + } catch { loadedTranslation = (await import(`../../../translations/base.json`)) as unknown as Translation } diff --git a/src/core/utils/copyToClipboard.ts b/src/core/utils/copyToClipboard.ts index 9303caeb2..1c7fb0d4f 100644 --- a/src/core/utils/copyToClipboard.ts +++ b/src/core/utils/copyToClipboard.ts @@ -15,7 +15,7 @@ export const copyToClipboard: (value: string, options?: { ignoreComment?: boolea try { navigator.clipboard.writeText(serializedValue) - } catch (error) { + } catch { addToast({ severity: 'danger', translateKey: 'text_63a5ba11eb4e7e17ef88e9f0',