chore(lint): jsx-no-useless-fragment in app

This commit is contained in:
Mohamed Boudra
2026-04-24 03:28:22 +07:00
parent d3a94e8cf2
commit edb071cb7b
10 changed files with 35 additions and 37 deletions

View File

@@ -408,7 +408,7 @@ vi.mock("@/components/ui/shortcut", () => ({
}));
vi.mock("@/components/ui/tooltip", () => ({
Tooltip: ({ children }: { children: React.ReactNode }) => <>{children}</>,
Tooltip: ({ children }: { children: React.ReactNode }) => children,
TooltipTrigger: ({
asChild,
children,
@@ -423,13 +423,13 @@ vi.mock("@/components/ui/tooltip", () => ({
disabled?: boolean;
}) =>
asChild ? (
<>{children}</>
children
) : (
<button type="button" aria-label={accessibilityLabel} disabled={disabled} onClick={onPress}>
{typeof children === "function" ? children({ hovered: false }) : children}
</button>
),
TooltipContent: ({ children }: { children: React.ReactNode }) => <>{children}</>,
TooltipContent: ({ children }: { children: React.ReactNode }) => children,
}));
vi.mock("@/components/ui/dropdown-menu", () => {

View File

@@ -27,7 +27,7 @@ vi.mock("@dnd-kit/core", () => ({
}));
vi.mock("@dnd-kit/sortable", () => ({
SortableContext: ({ children }: React.PropsWithChildren) => <>{children}</>,
SortableContext: ({ children }: React.PropsWithChildren) => children,
arrayMove: <T,>(items: T[], from: number, to: number) => {
const next = [...items];
const [item] = next.splice(from, 1);

View File

@@ -40,7 +40,7 @@ export function FileDropZone({ children, onFilesDropped, disabled = false }: Fil
// On non-web platforms, just render children
if (!IS_WEB) {
return <>{children}</>;
return children;
}
return (

View File

@@ -12,5 +12,5 @@ export function HostRouteBootstrapBoundary({ children }: { children: ReactNode }
return <StartupSplashScreen bootstrapState={isDesktop ? bootstrapState : undefined} />;
}
return <>{children}</>;
return children;
}

View File

@@ -142,7 +142,7 @@ vi.mock("@/components/ui/shortcut", () => ({
}));
vi.mock("@/components/ui/tooltip", () => ({
Tooltip: ({ children }: { children: React.ReactNode }) => <>{children}</>,
Tooltip: ({ children }: { children: React.ReactNode }) => children,
TooltipTrigger: ({
asChild,
children,
@@ -152,17 +152,17 @@ vi.mock("@/components/ui/tooltip", () => ({
children: React.ReactNode | ((state: { hovered: boolean }) => React.ReactNode);
} & Record<string, any>) =>
asChild ? (
<>{children}</>
children
) : (
<button type="button" aria-label={props.accessibilityLabel}>
{typeof children === "function" ? children({ hovered: false }) : children}
</button>
),
TooltipContent: ({ children }: { children: React.ReactNode }) => <>{children}</>,
TooltipContent: ({ children }: { children: React.ReactNode }) => children,
}));
vi.mock("@/components/ui/dropdown-menu", () => ({
DropdownMenu: ({ children }: { children: React.ReactNode }) => <>{children}</>,
DropdownMenu: ({ children }: { children: React.ReactNode }) => children,
DropdownMenuTrigger: ({
children,
testID,

View File

@@ -27,7 +27,7 @@ vi.mock("@dnd-kit/core", () => ({
}));
vi.mock("@dnd-kit/sortable", () => ({
SortableContext: ({ children }: React.PropsWithChildren) => <>{children}</>,
SortableContext: ({ children }: React.PropsWithChildren) => children,
arrayMove: <T,>(items: T[], from: number, to: number) => {
const next = [...items];
const [item] = next.splice(from, 1);

View File

@@ -315,7 +315,7 @@ export function Combobox({
keepOpenOnSelect = false,
anchorRef,
children,
}: ComboboxProps): ReactElement {
}: ComboboxProps): ReactElement | null {
const { theme } = useUnistyles();
const isMobile = useIsCompactFormFactor();
const titleColor = theme.colors.foreground;
@@ -704,24 +704,21 @@ export function Combobox({
/>
);
const optionsList = (
<>
{orderedVisibleOptions.length > 0 ? (
orderedVisibleOptions.map((opt, index) => (
<OptionRow
key={opt.id}
option={opt}
selected={opt.id === value}
active={index === activeIndex}
onSelect={handleSelect}
renderOption={renderOption}
/>
))
) : (
<ComboboxEmpty>{emptyText}</ComboboxEmpty>
)}
</>
);
const optionsList =
orderedVisibleOptions.length > 0 ? (
orderedVisibleOptions.map((opt, index) => (
<OptionRow
key={opt.id}
option={opt}
selected={opt.id === value}
active={index === activeIndex}
onSelect={handleSelect}
renderOption={renderOption}
/>
))
) : (
<ComboboxEmpty>{emptyText}</ComboboxEmpty>
);
const defaultContent = optionsList;
@@ -802,7 +799,7 @@ export function Combobox({
);
}
if (!isOpen) return <></>;
if (!isOpen) return null;
return (
<Modal transparent animationType="none" visible={isOpen} onRequestClose={handleClose}>

View File

@@ -16,7 +16,7 @@ vi.mock("@/constants/layout", () => ({
}));
vi.mock("@gorhom/portal", () => ({
Portal: ({ children }: { children: React.ReactNode }) => <>{children}</>,
Portal: ({ children }: { children: React.ReactNode }) => children,
}));
vi.mock("@gorhom/bottom-sheet", () => ({

View File

@@ -6,6 +6,7 @@ import {
useState,
type PropsWithChildren,
type ReactElement,
type ReactNode,
} from "react";
import { Dimensions, Platform, Text, View } from "react-native";
import Animated, { FadeIn, FadeOut } from "react-native-reanimated";
@@ -81,10 +82,10 @@ export function WorkspaceHoverCard({
prHint,
isDragging,
children,
}: PropsWithChildren<WorkspaceHoverCardProps>): ReactElement {
}: PropsWithChildren<WorkspaceHoverCardProps>): ReactNode {
// Desktop-only: skip on non-web platforms
if (Platform.OS !== "web") {
return <>{children}</>;
return children;
}
return (

View File

@@ -430,9 +430,9 @@ vi.mock("@/components/headers/screen-header", () => ({
}));
vi.mock("@/components/ui/tooltip", () => ({
Tooltip: ({ children }: { children: React.ReactNode }) => <>{children}</>,
TooltipTrigger: ({ children }: { children: React.ReactNode }) => <>{children}</>,
TooltipContent: ({ children }: { children: React.ReactNode }) => <>{children}</>,
Tooltip: ({ children }: { children: React.ReactNode }) => children,
TooltipTrigger: ({ children }: { children: React.ReactNode }) => children,
TooltipContent: ({ children }: { children: React.ReactNode }) => children,
}));
function ComboboxOptionButton({