Skip to content

Commit

Permalink
fix(eslint): typescript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
keellyp committed Nov 5, 2024
1 parent 5558eac commit 2a0bf62
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 28 deletions.
22 changes: 6 additions & 16 deletions src/components/designSystem/Skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<TSkeletonVariant, 'userAvatar' | 'connectorAvatar'>
variant: Extract<SkeletonVariant, 'userAvatar' | 'connectorAvatar'>
size: AvatarSize
/**
* @deprecated Use `className` and TailwindCSS instead
Expand All @@ -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<TSkeletonVariant, 'text' | 'circular'>
variant: Extract<SkeletonVariant, 'text' | 'circular'>
/**
* @deprecated Use `className` and TailwindCSS instead
*/
Expand All @@ -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', {
Expand Down
6 changes: 3 additions & 3 deletions src/components/form/JsonEditor/JsonEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/integrations/AddAnrokDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const AddAnrokDialog = forwardRef<AddAnrokDialogRef>((_, ref) => {
},
context: { silentErrorCodes: [LagoApiError.UnprocessableEntity] },
})
} catch (error) {}
} catch {}
}

const { errors } = res as
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/integrations/AddHubspotDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const AddHubspotDialog = forwardRef<AddHubspotDialogRef>((_, ref) => {
return handleError(res.errors)
}
}
} catch (error) {
} catch {
setShowGlobalError(true)
return
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/integrations/AddNetsuiteDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export const AddNetsuiteDialog = forwardRef<AddNetsuiteDialogRef>((_, ref) => {
return handleError(res.errors)
}
}
} catch (error) {
} catch {
setShowGlobalError(true)
return
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/integrations/AddXeroDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const AddXeroDialog = forwardRef<AddXeroDialogRef>((_, ref) => {
return handleError(res.errors)
}
}
} catch (error) {
} catch {
setShowGlobalError(true)
return
}
Expand Down
5 changes: 2 additions & 3 deletions src/core/apolloClient/cacheUtils.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -28,7 +27,7 @@ export const getItemFromLS = (key: string) => {

try {
return data === 'undefined' ? undefined : !!data ? JSON.parse(data) : data
} catch (err) {
} catch {
return data
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/translations/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const getTranslations: (locale: Locale) => Promise<Record<string, string>
// 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
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/utils/copyToClipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 2a0bf62

Please sign in to comment.