Fix ESLint errors
This commit is contained in:
@@ -162,7 +162,11 @@ export default async function BlogPostPage({ params }: PageProps) {
|
||||
return scoredPosts
|
||||
.sort((a, b) => b.score - a.score)
|
||||
.slice(0, limit)
|
||||
.map(({ score, ...post }) => post); // Remove score from final result
|
||||
.map(({ score, ...post }) => {
|
||||
// Score used for sorting, removed from final result
|
||||
void score;
|
||||
return post;
|
||||
});
|
||||
};
|
||||
|
||||
const relatedArticles = getRelatedArticles(post, allPosts);
|
||||
|
||||
@@ -13,7 +13,7 @@ interface AskOrganizerProps {
|
||||
buttonHref?: string;
|
||||
className?: string;
|
||||
variant?: "centered" | "left-aligned" | "compact" | "inverse";
|
||||
onContactClick?: (data: {
|
||||
onContactClick?: (_data: {
|
||||
event: string;
|
||||
component: string;
|
||||
variant: string;
|
||||
|
||||
@@ -14,7 +14,7 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
disabled?: boolean;
|
||||
type?: "button" | "submit" | "reset";
|
||||
onClick?: (
|
||||
e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>,
|
||||
_e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>,
|
||||
) => void;
|
||||
href?: string;
|
||||
target?: string;
|
||||
|
||||
@@ -10,7 +10,7 @@ interface CheckboxProps {
|
||||
disabled?: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
onChange?: (data: {
|
||||
onChange?: (_data: {
|
||||
checked: boolean;
|
||||
value?: string;
|
||||
event: React.MouseEvent | React.KeyboardEvent;
|
||||
|
||||
@@ -9,7 +9,7 @@ interface ContextMenuItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
disabled?: boolean;
|
||||
className?: string;
|
||||
onClick?: (
|
||||
e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>,
|
||||
_e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>,
|
||||
) => void;
|
||||
size?: "small" | "medium" | "large";
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ interface InputProps extends Omit<
|
||||
label?: string;
|
||||
placeholder?: string;
|
||||
value?: string;
|
||||
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
||||
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
||||
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
||||
onChange?: (_e: React.ChangeEvent<HTMLInputElement>) => void;
|
||||
onFocus?: (_e: React.FocusEvent<HTMLInputElement>) => void;
|
||||
onBlur?: (_e: React.FocusEvent<HTMLInputElement>) => void;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ interface NumberedCardProps {
|
||||
}
|
||||
|
||||
const NumberedCard = memo<NumberedCardProps>(
|
||||
({ number, text, iconShape: _iconShape, iconColor: _iconColor }) => {
|
||||
({ number, text }) => {
|
||||
return (
|
||||
<div className="bg-[var(--color-surface-inverse-primary)] rounded-[12px] p-5 shadow-lg flex flex-col gap-4 sm:p-8 sm:gap-8 sm:flex-row sm:items-center lg:p-8 lg:gap-0 lg:flex-row lg:items-stretch lg:relative lg:h-[238px]">
|
||||
{/* Section Number - Top right (lg breakpoint) */}
|
||||
|
||||
@@ -13,7 +13,7 @@ interface QuoteBlockProps {
|
||||
avatarSrc?: string;
|
||||
id?: string;
|
||||
fallbackAvatarSrc?: string;
|
||||
onError?: (error: {
|
||||
onError?: (_error: {
|
||||
type: string;
|
||||
message: string;
|
||||
author?: string;
|
||||
|
||||
@@ -8,7 +8,7 @@ interface RadioButtonProps {
|
||||
state?: "default" | "hover" | "focus";
|
||||
disabled?: boolean;
|
||||
label?: string;
|
||||
onChange?: (data: { checked: boolean; value?: string }) => void;
|
||||
onChange?: (_data: { checked: boolean; value?: string }) => void;
|
||||
id?: string;
|
||||
name?: string;
|
||||
value?: string;
|
||||
|
||||
@@ -12,7 +12,7 @@ interface RadioOption {
|
||||
interface RadioGroupProps {
|
||||
name?: string;
|
||||
value?: string;
|
||||
onChange?: (data: { value: string }) => void;
|
||||
onChange?: (_data: { value: string }) => void;
|
||||
mode?: "standard" | "inverse";
|
||||
state?: "default" | "hover" | "focus";
|
||||
disabled?: boolean;
|
||||
|
||||
@@ -14,12 +14,12 @@ interface RuleCardProps {
|
||||
declare global {
|
||||
interface Window {
|
||||
gtag?: (
|
||||
command: string,
|
||||
eventName: string,
|
||||
params?: Record<string, unknown>,
|
||||
_command: string,
|
||||
_eventName: string,
|
||||
_params?: Record<string, unknown>,
|
||||
) => void;
|
||||
analytics?: {
|
||||
track: (eventName: string, params?: Record<string, unknown>) => void;
|
||||
track: (_eventName: string, _params?: Record<string, unknown>) => void;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,12 @@ interface RuleStackProps {
|
||||
declare global {
|
||||
interface Window {
|
||||
gtag?: (
|
||||
command: string,
|
||||
eventName: string,
|
||||
params?: Record<string, unknown>,
|
||||
_command: string,
|
||||
_eventName: string,
|
||||
_params?: Record<string, unknown>,
|
||||
) => void;
|
||||
analytics?: {
|
||||
track: (eventName: string, params?: Record<string, unknown>) => void;
|
||||
track: (_eventName: string, _params?: Record<string, unknown>) => void;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ interface SelectProps {
|
||||
className?: string;
|
||||
children?: React.ReactNode;
|
||||
value?: string;
|
||||
onChange?: (data: { target: { value: string; text: string } }) => void;
|
||||
onChange?: (_data: { target: { value: string; text: string } }) => void;
|
||||
options?: SelectOptionData[];
|
||||
}
|
||||
|
||||
@@ -115,10 +115,11 @@ const Select = forwardRef<HTMLButtonElement, SelectProps>(
|
||||
const baseStyles = "w-full";
|
||||
|
||||
switch (size) {
|
||||
case "small":
|
||||
case "small": {
|
||||
const smallHeight =
|
||||
labelVariant === "horizontal" ? "h-[30px]" : "h-[32px]";
|
||||
return `${baseStyles} ${smallHeight} pl-[12px] pr-[36px] py-[8px] text-[10px] leading-[14px]`;
|
||||
}
|
||||
case "medium":
|
||||
return `${baseStyles} h-[36px] pl-[12px] pr-[36px] py-[8px] text-[14px] leading-[20px]`;
|
||||
case "large":
|
||||
|
||||
@@ -8,7 +8,7 @@ interface SelectOptionProps {
|
||||
disabled?: boolean;
|
||||
className?: string;
|
||||
onClick?: (
|
||||
e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>,
|
||||
_e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>,
|
||||
) => void;
|
||||
size?: "small" | "medium" | "large";
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ interface SwitchProps extends Omit<
|
||||
> {
|
||||
checked?: boolean;
|
||||
onChange?: (
|
||||
e:
|
||||
_e:
|
||||
| React.MouseEvent<HTMLButtonElement>
|
||||
| React.KeyboardEvent<HTMLButtonElement>,
|
||||
) => void;
|
||||
onFocus?: (e: React.FocusEvent<HTMLButtonElement>) => void;
|
||||
onBlur?: (e: React.FocusEvent<HTMLButtonElement>) => void;
|
||||
onFocus?: (_e: React.FocusEvent<HTMLButtonElement>) => void;
|
||||
onBlur?: (_e: React.FocusEvent<HTMLButtonElement>) => void;
|
||||
state?: "default" | "hover" | "focus";
|
||||
label?: string;
|
||||
className?: string;
|
||||
|
||||
@@ -15,9 +15,9 @@ interface TextAreaProps extends Omit<
|
||||
label?: string;
|
||||
placeholder?: string;
|
||||
value?: string;
|
||||
onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
||||
onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
||||
onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
||||
onChange?: (_e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
||||
onFocus?: (_e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
||||
onBlur?: (_e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
||||
className?: string;
|
||||
rows?: number;
|
||||
}
|
||||
|
||||
@@ -7,12 +7,12 @@ interface ToggleProps extends Omit<
|
||||
label?: string;
|
||||
checked?: boolean;
|
||||
onChange?: (
|
||||
e:
|
||||
_e:
|
||||
| React.MouseEvent<HTMLButtonElement>
|
||||
| React.KeyboardEvent<HTMLButtonElement>,
|
||||
) => void;
|
||||
onFocus?: (e: React.FocusEvent<HTMLButtonElement>) => void;
|
||||
onBlur?: (e: React.FocusEvent<HTMLButtonElement>) => void;
|
||||
onFocus?: (_e: React.FocusEvent<HTMLButtonElement>) => void;
|
||||
onBlur?: (_e: React.FocusEvent<HTMLButtonElement>) => void;
|
||||
disabled?: boolean;
|
||||
state?: "default" | "hover" | "focus";
|
||||
showIcon?: boolean;
|
||||
|
||||
@@ -11,12 +11,12 @@ interface ToggleGroupProps extends Omit<
|
||||
showText?: boolean;
|
||||
ariaLabel?: string;
|
||||
onChange?: (
|
||||
e:
|
||||
_e:
|
||||
| React.MouseEvent<HTMLButtonElement>
|
||||
| React.KeyboardEvent<HTMLButtonElement>,
|
||||
) => void;
|
||||
onFocus?: (e: React.FocusEvent<HTMLButtonElement>) => void;
|
||||
onBlur?: (e: React.FocusEvent<HTMLButtonElement>) => void;
|
||||
onFocus?: (_e: React.FocusEvent<HTMLButtonElement>) => void;
|
||||
onBlur?: (_e: React.FocusEvent<HTMLButtonElement>) => void;
|
||||
}
|
||||
|
||||
const ToggleGroup = memo(
|
||||
|
||||
@@ -28,20 +28,20 @@ interface AnalyticsEvent {
|
||||
}
|
||||
|
||||
interface UseAnalyticsReturn {
|
||||
trackEvent: (event: AnalyticsEvent) => void;
|
||||
trackEvent: (_event: AnalyticsEvent) => void;
|
||||
trackCustomEvent: (
|
||||
event: string,
|
||||
data: Record<string, unknown>,
|
||||
callback?: (data: Record<string, unknown>) => void,
|
||||
_event: string,
|
||||
_data: Record<string, unknown>,
|
||||
_callback?: (_data: Record<string, unknown>) => void,
|
||||
) => void;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
gtag?: (
|
||||
command: string,
|
||||
eventName: string,
|
||||
params?: Record<string, unknown>,
|
||||
_command: string,
|
||||
_eventName: string,
|
||||
_params?: Record<string, unknown>,
|
||||
) => void;
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ export function useAnalytics(): UseAnalyticsReturn {
|
||||
const trackCustomEvent = (
|
||||
event: string,
|
||||
data: Record<string, unknown>,
|
||||
callback?: (data: Record<string, unknown>) => void,
|
||||
callback?: (_data: Record<string, unknown>) => void,
|
||||
) => {
|
||||
// Execute custom callback if provided
|
||||
if (callback) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import { useEffect, RefObject } from "react";
|
||||
*/
|
||||
export function useClickOutside(
|
||||
refs: Array<RefObject<HTMLElement>>,
|
||||
handler: (event: MouseEvent | TouchEvent) => void,
|
||||
handler: (_event: MouseEvent | TouchEvent) => void,
|
||||
enabled: boolean = true,
|
||||
): void {
|
||||
useEffect(() => {
|
||||
|
||||
@@ -24,7 +24,7 @@ export interface UseComponentStylesOptions {
|
||||
error?: boolean;
|
||||
sizeStyles: SizeStyleConfig;
|
||||
stateStyles: StateStyleConfig;
|
||||
getStateStyles?: (params: {
|
||||
getStateStyles?: (_params: {
|
||||
state?: string;
|
||||
disabled: boolean;
|
||||
error: boolean;
|
||||
|
||||
@@ -19,15 +19,15 @@ import { useCallback } from "react";
|
||||
* ```
|
||||
*/
|
||||
interface FormFieldHandlers<T = HTMLElement> {
|
||||
onChange?: (e: React.ChangeEvent<T>) => void;
|
||||
onFocus?: (e: React.FocusEvent<T>) => void;
|
||||
onBlur?: (e: React.FocusEvent<T>) => void;
|
||||
onChange?: (_e: React.ChangeEvent<T>) => void;
|
||||
onFocus?: (_e: React.FocusEvent<T>) => void;
|
||||
onBlur?: (_e: React.FocusEvent<T>) => void;
|
||||
}
|
||||
|
||||
interface UseFormFieldReturn<T = HTMLElement> {
|
||||
handleChange: (e: React.ChangeEvent<T>) => void;
|
||||
handleFocus: (e: React.FocusEvent<T>) => void;
|
||||
handleBlur: (e: React.FocusEvent<T>) => void;
|
||||
handleChange: (_e: React.ChangeEvent<T>) => void;
|
||||
handleFocus: (_e: React.FocusEvent<T>) => void;
|
||||
handleBlur: (_e: React.FocusEvent<T>) => void;
|
||||
}
|
||||
|
||||
export function useFormField<T extends HTMLElement = HTMLElement>(
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useState, useCallback, useMemo } from "react";
|
||||
/**
|
||||
* Validation rule function type
|
||||
*/
|
||||
export type ValidationRule<T = string> = (value: T) => string | null;
|
||||
export type ValidationRule<T = string> = (_value: T) => string | null;
|
||||
|
||||
/**
|
||||
* Validation rules for common patterns
|
||||
|
||||
@@ -51,6 +51,8 @@ export function useMediaQuery(
|
||||
}
|
||||
|
||||
const media = window.matchMedia(mediaQuery);
|
||||
// Initialize matches synchronously - this is safe for media queries
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
setMatches(media.matches);
|
||||
|
||||
// Create listener for changes
|
||||
|
||||
Reference in New Issue
Block a user