From 92e72ce7bec9995b9dd0183ea76cffae0e0404a1 Mon Sep 17 00:00:00 2001 From: Sudev Kiyada Date: Thu, 4 Dec 2025 09:25:44 +0530 Subject: [PATCH] resolve linting errors --- src/components/Lottie/Lottie.svelte | 1 - src/components/Lottie/ts/types.ts | 65 ++++++++++++++--------------- src/components/Lottie/ts/utils.ts | 23 +--------- 3 files changed, 33 insertions(+), 56 deletions(-) diff --git a/src/components/Lottie/Lottie.svelte b/src/components/Lottie/Lottie.svelte index fa6960e3..a49c870f 100644 --- a/src/components/Lottie/Lottie.svelte +++ b/src/components/Lottie/Lottie.svelte @@ -11,7 +11,6 @@ isReverseMode, createRenderConfig, isNullish, - debounce, } from './ts/utils'; import { Tween } from 'svelte/motion'; diff --git a/src/components/Lottie/ts/types.ts b/src/components/Lottie/ts/types.ts index 64f17a8e..c8cdc2ee 100644 --- a/src/components/Lottie/ts/types.ts +++ b/src/components/Lottie/ts/types.ts @@ -1,44 +1,43 @@ - // Types import type { Snippet } from 'svelte'; import { - type Config, - type DotLottie as DotLottieType, + type Config, + type DotLottie as DotLottieType, } from '@lottiefiles/dotlottie-web'; import { type LottieState } from './lottieState.svelte'; type DotlottieProps = { - autoplay?: Config['autoplay']; - backgroundColor?: Config['backgroundColor']; - data?: Config['data']; - loop?: Config['loop']; - mode?: Config['mode']; - renderConfig?: Config['renderConfig']; - segment?: Config['segment']; - speed?: Config['speed']; - src: Config['src']; - useFrameInterpolation?: Config['useFrameInterpolation']; - marker?: Config['marker'] | undefined; - layout?: Config['layout']; - animationId?: Config['animationId']; - themeId?: Config['themeId']; - playOnHover?: boolean; - themeData?: string; - dotLottieRefCallback?: (dotLottie: DotLottieType) => void; - onLoad?: () => void; - onRender?: () => void; - onComplete?: () => void; + autoplay?: Config['autoplay']; + backgroundColor?: Config['backgroundColor']; + data?: Config['data']; + loop?: Config['loop']; + mode?: Config['mode']; + renderConfig?: Config['renderConfig']; + segment?: Config['segment']; + speed?: Config['speed']; + src: Config['src']; + useFrameInterpolation?: Config['useFrameInterpolation']; + marker?: Config['marker'] | undefined; + layout?: Config['layout']; + animationId?: Config['animationId']; + themeId?: Config['themeId']; + playOnHover?: boolean; + themeData?: string; + dotLottieRefCallback?: (dotLottie: DotLottieType) => void; + onLoad?: () => void; + onRender?: () => void; + onComplete?: () => void; }; export type Props = DotlottieProps & { - // Additional properties can be added here if needed - lottiePlayer?: DotLottieType | undefined; - showDebugInfo?: boolean; - height?: string; - lottieState?: LottieState; - progress?: number; - tweenDuration?: number; - easing?: (t: number) => number; - /** Children render function */ - children?: Snippet; + // Additional properties can be added here if needed + lottiePlayer?: DotLottieType | undefined; + showDebugInfo?: boolean; + height?: string; + lottieState?: LottieState; + progress?: number; + tweenDuration?: number; + easing?: (t: number) => number; + /** Children render function */ + children?: Snippet; }; diff --git a/src/components/Lottie/ts/utils.ts b/src/components/Lottie/ts/utils.ts index 5444bc86..afdb7b3b 100644 --- a/src/components/Lottie/ts/utils.ts +++ b/src/components/Lottie/ts/utils.ts @@ -106,27 +106,6 @@ export function createRenderConfig() { /** * Checks if a value is null or undefined (empty marker check) */ -export function isNullish(value: any): boolean { +export function isNullish(value: unknown): boolean { return value === null || value === undefined || value === ''; } - -/** - * Returns a debounced version of the given function. - * @template T - * @param {T} func - The function to debounce. - * @param {number} [delay=0] - The debounce delay in milliseconds. - * @returns {(...args: Parameters) => void} The debounced function. - */ -export function debounce void>( - func: T, - delay = 0 -) { - let timeoutId: ReturnType | undefined; - - return (...args: Parameters) => { - clearTimeout(timeoutId); - timeoutId = setTimeout(() => { - func(...args); - }, delay); - }; -}