chore: switch from biome to eslint + prettier; fix ton of lint issues

This commit is contained in:
Maze Winther
2026-04-29 00:37:56 +02:00
parent 6ec818fc11
commit d7692b4c79
159 changed files with 5630 additions and 5255 deletions
@@ -1,28 +1,25 @@
import { useEffect, useRef } from "react";
import { useEffect, useState } from "react";
import { useCommittedRef } from "@/hooks/use-committed-ref";
import { useSelectionContext } from "@/selection/context";
import { activateScope, type ScopeEntry } from "@/selection/scope";
export function useSelectionScope() {
const { selectedIds, clearSelection } = useSelectionContext();
const hasSelectionRef = useRef(selectedIds.length > 0);
const clearSelectionRef = useRef(clearSelection);
const hasSelection = selectedIds.length > 0;
hasSelectionRef.current = hasSelection;
clearSelectionRef.current = clearSelection;
const entryRef = useRef<ScopeEntry>({
const hasSelectionRef = useCommittedRef(hasSelection);
const clearSelectionRef = useCommittedRef(clearSelection);
const [entry] = useState<ScopeEntry>(() => ({
hasSelection: () => hasSelectionRef.current,
clear: () => {
clearSelectionRef.current();
},
});
}));
useEffect(() => {
if (!hasSelection) {
return;
}
return activateScope({ entry: entryRef.current });
}, [hasSelection]);
return activateScope({ entry });
}, [entry, hasSelection]);
}