Skip to content

Commit

Permalink
misc: remove some lint warnings (#1932)
Browse files Browse the repository at this point in the history
  • Loading branch information
ansmonjol authored Dec 24, 2024
1 parent fa2e708 commit c2d61b7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
2 changes: 0 additions & 2 deletions src/components/auth/GoogleAuthButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ const GoogleAuthButton = ({
size="large"
variant="tertiary"
onClick={async () => {
// Ignored because error received here is a 500, and is not well formated for this use case
// @ts-ignore
const { data, errors } = await getGoogleUrl()

// Note: keep underscore notation for some error codes
Expand Down
5 changes: 1 addition & 4 deletions src/components/designSystem/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,9 @@ const getBackgroundColorKey = (identifier?: string): keyof typeof colors.avatar
return acc
}, 0)

// From the modulo of the color number, get the modulo
const colorKeys = Object.keys(colors.avatar)

const colorKeys = Object.keys(colors.avatar) as Array<keyof typeof colors.avatar>
const colorIndex = charcodeSum % colorKeys.length

// @ts-expect-error
return colorKeys[colorIndex]
}

Expand Down
5 changes: 3 additions & 2 deletions src/components/designSystem/Popper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ export const Popper = forwardRef<PopperRef, PopperProps>(
},
ref: openerRef,
})
: // @ts-expect-error
cloneElement(opener, { onClick: toggle, ref: openerRef })}
: !!opener
? cloneElement(opener, { onClick: toggle, ref: openerRef })
: null}
<MuiPopper
className={tw(displayInDialog ? 'z-dialog' : 'z-popper')}
style={{ minWidth: `${minWidth ?? openerRef?.current?.offsetWidth ?? 0}px` }}
Expand Down
5 changes: 2 additions & 3 deletions src/components/designSystem/Toasts/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface ToastRef {
const AUTO_DISMISS_TIME = 6000

const containerStyles = cva(
'mt-4 box-border flex max-h-[300px] w-fit max-w-[360px] animate-enter items-center justify-start overflow-hidden rounded-xl px-4 py-3 text-white transition-all delay-[0ms] duration-[250ms] ease-in-out',
'mt-4 box-border flex max-h-[300px] w-fit max-w-[360px] animate-enter items-center justify-start overflow-hidden rounded-xl px-4 py-3 text-white transition-all delay-[0ms] duration-250 ease-in-out',
{
variants: {
severity: {
Expand All @@ -33,15 +33,14 @@ const containerStyles = cva(

export const Toast = forwardRef<ToastRef, ToastProps>(({ toast }: ToastProps, ref) => {
const [closing, setClosing] = useState(false)
const timeoutRef = useRef(null)
const timeoutRef = useRef<NodeJS.Timeout | null>(null)
const { translate } = useInternationalization()
const { id, severity = ToastSeverityEnum.info, autoDismiss = true, message, translateKey } = toast

const startTimeout = useCallback(
(time = AUTO_DISMISS_TIME) => {
if (!autoDismiss) return

// @ts-expect-error
timeoutRef.current = setTimeout(() => {
setClosing(true)
}, time)
Expand Down
1 change: 0 additions & 1 deletion src/components/plans/ChargeAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ export const ChargeAccordion = memo(
hasDefaultPropertiesErrors:
typeof chargeErrors === 'object' &&
typeof chargeErrors[index] === 'object' &&
// @ts-ignore
typeof chargeErrors[index].properties === 'object',
hasErrorInCharges: Boolean(chargeErrors && chargeErrors[index]),
initialLocalCharge: formikProps.initialValues.charges[index],
Expand Down
2 changes: 1 addition & 1 deletion src/core/serializers/serializePlanInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const serializeProperties = (properties: Properties, chargeModel: ChargeModelEnu
return {
...properties,
...([ChargeModelEnum.Standard, ChargeModelEnum.Dynamic].includes(chargeModel)
? // @ts-ignore EDIT: groupedBy is a string at this stage. need to send string[] to BE
? // @ts-expect-error EDIT: groupedBy is a string at this stage. need to send string[] to BE
{ groupedBy: !!properties?.groupedBy ? properties?.groupedBy.split(',') : undefined }
: { groupedBy: undefined }),
...([ChargeModelEnum.Package, ChargeModelEnum.Standard].includes(chargeModel)
Expand Down

0 comments on commit c2d61b7

Please sign in to comment.