chore: apply oxlint autofix (safe level)

Auto-fixed 102 warnings (6040 → 5938) across 57 files. Main categories:
- preserve-caught-error: add { cause: error } to re-thrown errors
- unicorn/no-array-reverse: .reverse() → .toReversed()
- unicorn/no-useless-fallback-in-spread: drop unnecessary ?? {} in spreads
- oxc/no-map-spread: rewrite object spread in .map() to Object.assign
- react-hooks/exhaustive-deps: trim module-level constants from dep arrays

Ran npm run format after to clean up whitespace from lint mutations.
This commit is contained in:
Mohamed Boudra
2026-04-23 21:47:36 +07:00
parent 9c88850de0
commit 177153e5e8
57 changed files with 152 additions and 151 deletions
@@ -618,7 +618,7 @@ export function CombinedModelSelector({
});
return () => cancelAnimationFrame(frame);
}, [isOpen, platformIsWeb]);
}, [isOpen]);
return (
<>
@@ -287,14 +287,14 @@ export function FileExplorerPane({
directoryPaths.unshift(".");
}
await Promise.all([
...directoryPaths.map((path) =>
await Promise.all(
directoryPaths.map((path) =>
requestDirectoryListing(path, {
recordHistory: false,
setCurrentPath: false,
}),
),
]);
);
return null;
},
enabled: false,
@@ -2158,7 +2158,6 @@ export function SidebarWorkspaceList({
serverId,
shortcutIndexByWorkspaceKey,
showShortcutBadges,
platformIsNative,
creatingWorkspaceIds,
],
);
@@ -122,8 +122,9 @@ export function createStreamStrategy(config: StreamStrategyConfig): StreamStrate
return {
render: config.render,
orderTail: (streamItems) =>
config.orderTailReverse ? [...streamItems].reverse() : streamItems,
orderHead: (streamHead) => (config.orderHeadReverse ? [...streamHead].reverse() : streamHead),
config.orderTailReverse ? [...streamItems].toReversed() : streamItems,
orderHead: (streamHead) =>
config.orderHeadReverse ? [...streamHead].toReversed() : streamHead,
getNeighborIndex: (index, relation) =>
relation === "above"
? index + config.assistantTurnTraversalStep
@@ -153,7 +154,7 @@ export function createStreamStrategy(config: StreamStrategyConfig): StreamStrate
messages.push(currentItem.text);
}
}
return messages.reverse().join("\n\n");
return messages.toReversed().join("\n\n");
},
isNearBottom: (input) => config.isNearBottom(input),
getBottomOffset: (metrics) => config.getBottomOffset(metrics),
@@ -9,7 +9,7 @@ export function orderAutocompleteOptions<T>(
if (position === "below-input") {
return [...options];
}
return [...options].reverse();
return [...options].toReversed();
}
export function getAutocompleteFallbackIndex(
@@ -113,7 +113,7 @@ export function orderVisibleComboboxOptions(
if (optionsPosition !== "above-search") {
return visibleOptions;
}
return [...visibleOptions].reverse();
return [...visibleOptions].toReversed();
}
export function getComboboxFallbackIndex(
@@ -279,26 +279,23 @@ export function WebDesktopScrollbarOverlay({
setIsDragging(false);
},
});
}, [applyDragDelta, platformIsWeb]);
}, [applyDragDelta]);
const startWebDrag = useCallback(
(event: any) => {
if (!platformIsWeb) {
return;
}
const clientY = readClientY(event);
if (clientY === null) {
return;
}
event?.preventDefault?.();
event?.stopPropagation?.();
event?.nativeEvent?.preventDefault?.();
dragStartOffsetRef.current = normalizedOffsetRef.current;
dragStartClientYRef.current = clientY;
setIsDragging(true);
},
[platformIsWeb],
);
const startWebDrag = useCallback((event: any) => {
if (!platformIsWeb) {
return;
}
const clientY = readClientY(event);
if (clientY === null) {
return;
}
event?.preventDefault?.();
event?.stopPropagation?.();
event?.nativeEvent?.preventDefault?.();
dragStartOffsetRef.current = normalizedOffsetRef.current;
dragStartClientYRef.current = clientY;
setIsDragging(true);
}, []);
const handleGrabHoverIn = useCallback(() => {
if (!isScrollVisible && !isDragging) {
@@ -334,7 +331,7 @@ export function WebDesktopScrollbarOverlay({
window.removeEventListener("pointerup", stopDragging);
window.removeEventListener("pointercancel", stopDragging);
};
}, [applyDragDelta, isDragging, platformIsWeb]);
}, [applyDragDelta, isDragging]);
if (!enabled || !geometry.isVisible) {
return null;