From c93feb5dfc3d5cefa83391ff2e4df7d11ad8e0fa Mon Sep 17 00:00:00 2001 From: James Brunton Date: Wed, 26 Aug 2026 14:09:55 +0000 Subject: [PATCH] Remove a bunch of unnecessary casts from the frontend (#7662) # Description of Changes Originally, I wanted to re-enable typed linting on our repo but using Oxlint this time to avoid the memory and speed issues that ESLint was causing. Unfortunately, it's not stable enough yet to actually use on our repo (although it is close, I suspect it'll be stable enough fairly soon). I was able to remove many of the unnecessary casts that it found though, so even though this won't be enforced, it's still worth cleaning up what I've found. --- .../config/configSections/TeamSection.tsx | 8 +++--- .../core/components/fileEditor/FileEditor.tsx | 7 ++--- .../components/filesPage/FileDetailsPanel.tsx | 2 +- .../core/components/filesPage/FileGrid.tsx | 12 ++++----- .../components/filesPage/FileManagerView.tsx | 8 +++--- .../components/filesPage/VersionTimeline.tsx | 6 ++--- .../components/filesPage/folderTreeWidth.ts | 2 +- .../mobileSign/MobileDrawCanvas.tsx | 4 +-- .../core/components/onboarding/Onboarding.tsx | 3 +-- .../pageEditor/commands/pageCommands.ts | 2 +- .../shared/superSearch/SuperSearch.test.tsx | 4 +-- .../wetSignature/SignatureTypeSelector.tsx | 2 +- .../core/components/toast/ToastContext.tsx | 9 +++---- .../components/tools/FullscreenToolList.tsx | 10 +++---- .../core/components/tools/RightSidebar.tsx | 4 +-- .../core/components/tools/ToolRenderer.tsx | 4 +-- .../addPageNumbers/PageNumberPreview.tsx | 7 +---- .../addWatermark/WatermarkStyleSettings.tsx | 16 +++-------- .../AdjustPageScaleSettings.tsx | 4 +-- .../tools/certSign/WetSignatureInput.tsx | 4 +-- .../compare/ComparePixelWorkbenchView.tsx | 2 +- .../tools/compare/CompareWorkbenchView.tsx | 7 +++-- .../core/components/tools/compare/compare.ts | 2 +- .../hooks/useCompareChangeNavigation.ts | 6 ++--- .../tools/compare/hooks/useComparePanZoom.ts | 10 +++---- .../hooks/useCompareWorkbenchBarButtons.tsx | 3 +-- .../fullscreen/DetailedToolItem.stories.tsx | 4 +-- .../tools/overlayPdfs/OverlayPdfsSettings.tsx | 2 +- .../pdfTextEditor/PdfTextEditorSidebar.tsx | 4 +-- .../tools/shared/ReviewToolStep.tsx | 9 +++---- .../src/core/components/tools/showJS/utils.ts | 4 +-- .../tools/sign/MobileSignatureModal.test.tsx | 8 +++--- .../components/tools/sign/SignSettings.tsx | 6 ++--- .../tools/toolPicker/ToolButton.tsx | 4 +-- .../ValidateSignatureResults.tsx | 2 +- .../file/classificationToolRace.test.ts | 7 ++--- .../core/data/usePrototypeToolRegistry.tsx | 2 +- .../useAddPasswordOperation.test.ts | 2 +- .../autoRotate/useAutoRotateOperation.ts | 3 +-- .../tools/automate/useAutomateOperation.ts | 2 +- .../hooks/tools/compare/operationUtils.ts | 6 ++--- .../tools/compare/useCompareOperation.ts | 7 +++-- .../tools/convert/useConvertOperation.ts | 17 +++--------- .../core/hooks/tools/shared/toolAutomation.ts | 2 +- .../tools/shared/toolOperationDescriptor.ts | 9 +++---- .../hooks/tools/shared/toolOperationTypes.ts | 4 +-- .../hooks/tools/shared/useToolOperation.ts | 10 ++----- .../core/hooks/tools/useFavoriteToolItems.ts | 4 +-- .../utils/signatureStatus.test.ts | 5 +--- frontend/editor/src/core/i18n.ts | 2 +- frontend/editor/src/core/setupTests.ts | 2 +- .../src/core/tests/stubbed/settings.spec.ts | 8 ++---- frontend/editor/src/core/tools/Compare.tsx | 8 +++--- frontend/editor/src/core/tools/SharedSign.tsx | 6 ++--- .../core/tools/annotate/AnnotationPanel.tsx | 18 ++++++------- .../core/tools/formFill/FormFieldOverlay.tsx | 2 +- .../core/tools/formFill/FormFillContext.tsx | 2 +- .../formFill/providers/PdfiumFormProvider.ts | 20 +++++--------- frontend/editor/src/core/ui/Checkbox.tsx | 4 +-- .../utils/bulkselection/parseSelection.ts | 4 +-- .../src/desktop/hooks/useEndpointConfig.ts | 9 ++++--- .../editor/src/portal/auth/saasSupabase.ts | 2 +- .../docs/EndpointReferenceSection.tsx | 4 +-- .../pipelines/PipelineStepSettings.test.tsx | 3 +-- .../components/policies/PolicySetupWizard.tsx | 2 +- .../processor-flow/useFlowParticles.ts | 5 +--- .../src/portal/mocks/handlers/policies.ts | 2 +- .../portal/mocks/handlers/procurementSaas.ts | 2 +- .../editor/src/portal/queries/adapters.ts | 2 +- frontend/editor/src/portal/setupTests.ts | 2 +- .../proprietary/auth/springAuthClient.test.ts | 16 +++++------ .../proprietary/auth/supabase/UseSession.tsx | 2 +- .../policies/policyRunSettles.test.ts | 27 +++++++++---------- .../policies/useClientSideClassification.ts | 6 ++--- .../components/policies/usePolicyAutoRun.ts | 4 +-- .../shared/FileSidebarGroupControls.tsx | 2 +- .../components/shared/InviteMembersModal.tsx | 2 +- .../components/shared/UpgradeBanner.tsx | 10 ++----- .../config/LoginLandingSetting.test.tsx | 2 +- .../AdminConnectionsSection.tsx | 6 ++--- .../configSections/AdminUsageSection.tsx | 6 ++--- .../configSections/audit/AuditEventsTable.tsx | 8 +++--- .../configSections/plan/LicenseKeySection.tsx | 2 +- .../usage/UsageAnalyticsTable.tsx | 8 +++--- .../components/shared/fileSidebarGrouping.tsx | 3 +-- .../shared/fileSidebarGroupingLogic.ts | 2 +- .../proprietary/hooks/useFolderRunStatuses.ts | 2 +- .../editor/src/proprietary/policies/codec.ts | 6 ++--- .../src/proprietary/routes/Login.test.tsx | 3 +-- .../services/heuristic/heuristicEngine.ts | 3 +-- .../services/heuristic/heuristicExtractor.ts | 3 +-- .../src/proprietary/services/policyExport.ts | 2 +- .../editor/src/saas/auth/UseSession.test.ts | 2 +- .../components/SignupRequiredBootstrap.tsx | 8 ++---- .../saas/components/shared/AppConfigModal.tsx | 18 +++++-------- .../shared/charts/StackedBarChart.tsx | 6 ++--- .../shared/config/configSections/Overview.tsx | 10 +------ .../components/tools/sign/SignSettings.tsx | 6 ++--- .../editor/src/saas/routes/OAuthConsent.tsx | 5 ++-- frontend/editor/src/saas/setupTests.ts | 2 +- 100 files changed, 217 insertions(+), 345 deletions(-) diff --git a/frontend/editor/src/cloud/components/shared/config/configSections/TeamSection.tsx b/frontend/editor/src/cloud/components/shared/config/configSections/TeamSection.tsx index 4eb064d8bf..ab8a184828 100644 --- a/frontend/editor/src/cloud/components/shared/config/configSections/TeamSection.tsx +++ b/frontend/editor/src/cloud/components/shared/config/configSections/TeamSection.tsx @@ -360,11 +360,9 @@ const TeamSection: React.FC = () => { verticalSpacing="sm" withRowBorders highlightOnHover - style={ - { - "--table-border-color": "var(--mantine-color-gray-3)", - } as React.CSSProperties - } + style={{ + "--table-border-color": "var(--mantine-color-gray-3)", + }} > { const index = stubsRef.current.findIndex((r) => r.id === fileId); if (index !== -1) { - setActiveFileId(fileId as string); + setActiveFileId(fileId); setActiveFileIndex(index); navActions.setWorkbench("viewer"); } @@ -410,10 +410,7 @@ const FileEditor = ({ onUnzipFile={handleUnzipFile} toolMode={toolMode} isSupported={isFileSupported(record.name)} - policies={ - policyFileBadges.get(record.id as string) ?? - EMPTY_POLICIES - } + policies={policyFileBadges.get(record.id) ?? EMPTY_POLICIES} /> ); })} diff --git a/frontend/editor/src/core/components/filesPage/FileDetailsPanel.tsx b/frontend/editor/src/core/components/filesPage/FileDetailsPanel.tsx index 693d8efae7..ff570bbe1d 100644 --- a/frontend/editor/src/core/components/filesPage/FileDetailsPanel.tsx +++ b/frontend/editor/src/core/components/filesPage/FileDetailsPanel.tsx @@ -140,7 +140,7 @@ export function FileDetailsPanel({ return null; } - const single = files.length === 1 ? files[0]! : null; + const single = files.length === 1 ? files[0] : null; const totalSize = files.reduce((sum, f) => sum + f.size, 0); const ext = single ? (single.name.split(".").pop() ?? "").toUpperCase() : ""; // Files still needing a server upload; drives Save-to-server visibility. diff --git a/frontend/editor/src/core/components/filesPage/FileGrid.tsx b/frontend/editor/src/core/components/filesPage/FileGrid.tsx index 40e17dc502..334ad76805 100644 --- a/frontend/editor/src/core/components/filesPage/FileGrid.tsx +++ b/frontend/editor/src/core/components/filesPage/FileGrid.tsx @@ -422,7 +422,7 @@ function GridView(props: FileGridProps) { parentPath={entry.parentPath} isSelected={selectedFileIds.has(entry.file.id)} isInWorkspace={ - activeWorkspaceFileIds?.has(entry.file.id as string) ?? false + activeWorkspaceFileIds?.has(entry.file.id) ?? false } selectedFileIds={selectedFileIds} multiSelectActive={selectedFileIds.size >= 2} @@ -938,7 +938,7 @@ function FileCard({ shiftKey: false, ctrlKey: true, metaKey: true, - } as unknown as React.MouseEvent); + }); }} onChange={() => { /* handled by onClick */ @@ -982,7 +982,7 @@ function FileCard({ · {fileDate} - +
@@ -1137,7 +1137,7 @@ function ListView( parentPath={entry.parentPath} isSelected={selectedFileIds.has(entry.file.id)} isInWorkspace={ - activeWorkspaceFileIds?.has(entry.file.id as string) ?? false + activeWorkspaceFileIds?.has(entry.file.id) ?? false } selectedFileIds={selectedFileIds} multiSelectActive={selectedFileIds.size >= 2} @@ -1424,7 +1424,7 @@ function FileRow({ shiftKey: false, ctrlKey: true, metaKey: true, - } as unknown as React.MouseEvent); + }); }} onChange={() => { /* handled by onClick */ @@ -1491,7 +1491,7 @@ function FileRow({ )} - + {isInWorkspace && ( diff --git a/frontend/editor/src/core/components/filesPage/FileManagerView.tsx b/frontend/editor/src/core/components/filesPage/FileManagerView.tsx index 36ffb9c4dc..4665784e79 100644 --- a/frontend/editor/src/core/components/filesPage/FileManagerView.tsx +++ b/frontend/editor/src/core/components/filesPage/FileManagerView.tsx @@ -474,7 +474,7 @@ export default function FileManagerView() { if (idx >= 0 && lastIdx >= 0) { const [a, b] = idx < lastIdx ? [idx, lastIdx] : [lastIdx, idx]; for (let i = a; i <= b; i += 1) { - next.add(visibleFiles[i]!.id); + next.add(visibleFiles[i].id); } return next; } @@ -593,7 +593,7 @@ export default function FileManagerView() { }); // Branch on requested stubs so already-active files still activate. if (materialized.length === 1) { - setActiveFileId(materialized[0]!.id); + setActiveFileId(materialized[0].id); navActions.setWorkbench("viewer"); } else if (materialized.length > 1) { navActions.setWorkbench("fileEditor"); @@ -1172,7 +1172,7 @@ export default function FileManagerView() { else if (e.key === "End") next = TAB_DEFS.length - 1; else return; e.preventDefault(); - const target = TAB_DEFS[next]!; + const target = TAB_DEFS[next]; setCurrentTab(target.id); focusTab(target.id); }} @@ -1602,7 +1602,7 @@ export default function FileManagerView() { ) ) return; - setViewMode(v as (typeof FILES_PAGE_VIEW_MODES)[number]); + setViewMode(v); }} aria-label={t("filesPage.viewMode.label", "View mode")} options={[ diff --git a/frontend/editor/src/core/components/filesPage/VersionTimeline.tsx b/frontend/editor/src/core/components/filesPage/VersionTimeline.tsx index 05c96685b2..f484f936ef 100644 --- a/frontend/editor/src/core/components/filesPage/VersionTimeline.tsx +++ b/frontend/editor/src/core/components/filesPage/VersionTimeline.tsx @@ -120,14 +120,14 @@ export function VersionTimeline({ }; const rows: Row[] = useMemo(() => { if (!collapsible || showAllCollapsed) { - return ordered.map((v) => ({ kind: "version", version: v }) as Row); + return ordered.map((v) => ({ kind: "version", version: v })); } const head = ordered .slice(0, 3) - .map((v) => ({ kind: "version", version: v }) as Row); + .map((v) => ({ kind: "version", version: v })); const tail = ordered .slice(-2) - .map((v) => ({ kind: "version", version: v }) as Row); + .map((v) => ({ kind: "version", version: v })); const hidden = ordered.length - 5; return [...head, { kind: "ellipsis", hidden }, ...tail]; }, [collapsible, showAllCollapsed, ordered]); diff --git a/frontend/editor/src/core/components/filesPage/folderTreeWidth.ts b/frontend/editor/src/core/components/filesPage/folderTreeWidth.ts index 4aaf8099ec..a88b0e7f11 100644 --- a/frontend/editor/src/core/components/filesPage/folderTreeWidth.ts +++ b/frontend/editor/src/core/components/filesPage/folderTreeWidth.ts @@ -27,7 +27,7 @@ function depthOf( let cursor: FolderRecord | undefined = folder; while (cursor && cursor.parentFolderId) { depth += 1; - cursor = byId.get(cursor.parentFolderId as string); + cursor = byId.get(cursor.parentFolderId); if (depth > 50) break; } return depth; diff --git a/frontend/editor/src/core/components/mobileSign/MobileDrawCanvas.tsx b/frontend/editor/src/core/components/mobileSign/MobileDrawCanvas.tsx index 38c2be8e6c..8461727240 100644 --- a/frontend/editor/src/core/components/mobileSign/MobileDrawCanvas.tsx +++ b/frontend/editor/src/core/components/mobileSign/MobileDrawCanvas.tsx @@ -139,9 +139,9 @@ export const MobileDrawCanvas = forwardRef< // where the per-frame synthetic event alone would drop curvature. const events = "getCoalescedEvents" in e.nativeEvent - ? (e.nativeEvent as PointerEvent).getCoalescedEvents() + ? e.nativeEvent.getCoalescedEvents() : [e.nativeEvent as PointerEvent]; - const rect = (e.currentTarget as HTMLCanvasElement).getBoundingClientRect(); + const rect = e.currentTarget.getBoundingClientRect(); for (const ev of events) { stroke.points.push({ x: ev.clientX - rect.left, diff --git a/frontend/editor/src/core/components/onboarding/Onboarding.tsx b/frontend/editor/src/core/components/onboarding/Onboarding.tsx index e95aaf57aa..3ce2e2701f 100644 --- a/frontend/editor/src/core/components/onboarding/Onboarding.tsx +++ b/frontend/editor/src/core/components/onboarding/Onboarding.tsx @@ -20,7 +20,6 @@ import { import { useOnboardingDownload } from "@app/components/onboarding/useOnboardingDownload"; import { SLIDE_DEFINITIONS, - type SlideId, type ButtonAction, } from "@app/components/onboarding/onboardingFlowConfig"; import ToolPanelModePrompt from "@app/components/tools/ToolPanelModePrompt"; @@ -322,7 +321,7 @@ export default function Onboarding() { ) { return null; } - return SLIDE_DEFINITIONS[currentStep.slideId as SlideId]; + return SLIDE_DEFINITIONS[currentStep.slideId]; }, [currentStep]); const currentSlideContent = useMemo(() => { diff --git a/frontend/editor/src/core/components/pageEditor/commands/pageCommands.ts b/frontend/editor/src/core/components/pageEditor/commands/pageCommands.ts index db9385fc37..2ce10b929c 100644 --- a/frontend/editor/src/core/components/pageEditor/commands/pageCommands.ts +++ b/frontend/editor/src/core/components/pageEditor/commands/pageCommands.ts @@ -244,7 +244,7 @@ export class ReorderPagesCommand extends DOMCommand { .map((pageNum) => currentDoc.pages.find((p) => p.pageNumber === pageNum), ) - .filter((page) => page !== undefined) as PDFPage[]; + .filter((page) => page !== undefined); const remainingPages = currentDoc.pages.filter( (page) => !this.selectedPages!.includes(page.pageNumber), diff --git a/frontend/editor/src/core/components/shared/superSearch/SuperSearch.test.tsx b/frontend/editor/src/core/components/shared/superSearch/SuperSearch.test.tsx index f77984f090..931c87197f 100644 --- a/frontend/editor/src/core/components/shared/superSearch/SuperSearch.test.tsx +++ b/frontend/editor/src/core/components/shared/superSearch/SuperSearch.test.tsx @@ -84,7 +84,7 @@ function renderSearch( , @@ -103,7 +103,7 @@ describe("SuperSearch", () => { width: 320, height: 40, toJSON: () => "", - } as DOMRect); + }); Object.defineProperty(Element.prototype, "scrollIntoView", { value: vi.fn(), diff --git a/frontend/editor/src/core/components/shared/wetSignature/SignatureTypeSelector.tsx b/frontend/editor/src/core/components/shared/wetSignature/SignatureTypeSelector.tsx index 7b4950f4aa..5cc14fcf3c 100644 --- a/frontend/editor/src/core/components/shared/wetSignature/SignatureTypeSelector.tsx +++ b/frontend/editor/src/core/components/shared/wetSignature/SignatureTypeSelector.tsx @@ -19,7 +19,7 @@ export const SignatureTypeSelector: React.FC = ({ return ( onChange(val as SignatureType)} + onChange={(val) => onChange(val)} options={[ { value: "draw", diff --git a/frontend/editor/src/core/components/toast/ToastContext.tsx b/frontend/editor/src/core/components/toast/ToastContext.tsx index a300dc1791..4fcc6d8b10 100644 --- a/frontend/editor/src/core/components/toast/ToastContext.tsx +++ b/frontend/editor/src/core/components/toast/ToastContext.tsx @@ -93,7 +93,7 @@ export function ToastProvider({ children }: { children: React.ReactNode }) { ? true : false, createdAt: Date.now(), - } as ToastInstance; + }; setToasts((prev) => { // Coalesce duplicates by alertType + title + body text if no explicit id was provided if (!options.id) { @@ -138,7 +138,7 @@ export function ToastProvider({ children }: { children: React.ReactNode }) { ...t, ...updates, progress, - } as ToastInstance; + }; // Detect completion but do not auto-flip to success. // Callers (e.g., compare workbench) explicitly set alertType when done. @@ -197,9 +197,8 @@ export function ToastProvider({ children }: { children: React.ReactNode }) { ), ); }; - window.addEventListener("toast:toggle", handler as EventListener); - return () => - window.removeEventListener("toast:toggle", handler as EventListener); + window.addEventListener("toast:toggle", handler); + return () => window.removeEventListener("toast:toggle", handler); }, []); return ( diff --git a/frontend/editor/src/core/components/tools/FullscreenToolList.tsx b/frontend/editor/src/core/components/tools/FullscreenToolList.tsx index 5296e21299..85a306c476 100644 --- a/frontend/editor/src/core/components/tools/FullscreenToolList.tsx +++ b/frontend/editor/src/core/components/tools/FullscreenToolList.tsx @@ -108,7 +108,7 @@ const FullscreenToolList = ({ window.open(tool.link, "_blank", "noopener,noreferrer"); return; } - onSelect(id as ToolId); + onSelect(id); }; if (showDescriptions) { @@ -274,15 +274,11 @@ const FullscreenToolList = ({ {showDescriptions ? (
- {tools.map(({ id, tool }) => - renderToolItem(id as ToolId, tool), - )} + {tools.map(({ id, tool }) => renderToolItem(id, tool))}
) : (
- {tools.map(({ id, tool }) => - renderToolItem(id as ToolId, tool), - )} + {tools.map(({ id, tool }) => renderToolItem(id, tool))}
)} diff --git a/frontend/editor/src/core/components/tools/RightSidebar.tsx b/frontend/editor/src/core/components/tools/RightSidebar.tsx index a4bdbced7e..d66d30c442 100644 --- a/frontend/editor/src/core/components/tools/RightSidebar.tsx +++ b/frontend/editor/src/core/components/tools/RightSidebar.tsx @@ -108,7 +108,7 @@ export default function RightSidebar() { const activeTool: ToolRegistryEntry | null = inToolView && selectedToolKey - ? (toolRegistry[selectedToolKey as ToolId] ?? null) + ? (toolRegistry[selectedToolKey] ?? null) : null; const expandedWidth = "18.5rem"; @@ -131,7 +131,7 @@ export default function RightSidebar() { const items: Array<{ id: ToolId; tool: ToolRegistryEntry }> = []; collapsedQuickSection.subcategories.forEach((sc: SubcategoryGroup) => sc.tools.forEach((entry) => - items.push({ id: entry.id as ToolId, tool: entry.tool }), + items.push({ id: entry.id, tool: entry.tool }), ), ); return items; diff --git a/frontend/editor/src/core/components/tools/ToolRenderer.tsx b/frontend/editor/src/core/components/tools/ToolRenderer.tsx index 1429231ab7..4c99afbca2 100644 --- a/frontend/editor/src/core/components/tools/ToolRenderer.tsx +++ b/frontend/editor/src/core/components/tools/ToolRenderer.tsx @@ -19,9 +19,7 @@ const ToolRenderer = ({ // Get the tool from context (instead of direct hook call) const { toolRegistry } = useToolWorkflow(); const selectedTool = - selectedToolKey in toolRegistry - ? toolRegistry[selectedToolKey as ToolId] - : undefined; + selectedToolKey in toolRegistry ? toolRegistry[selectedToolKey] : undefined; // Handle tools that only work in workbenches (read, multiTool) if (selectedTool && !selectedTool.component && selectedTool.workbench) { diff --git a/frontend/editor/src/core/components/tools/addPageNumbers/PageNumberPreview.tsx b/frontend/editor/src/core/components/tools/addPageNumbers/PageNumberPreview.tsx index 6e35b286a9..9991c4b849 100644 --- a/frontend/editor/src/core/components/tools/addPageNumbers/PageNumberPreview.tsx +++ b/frontend/editor/src/core/components/tools/addPageNumbers/PageNumberPreview.tsx @@ -261,12 +261,7 @@ export default function PageNumberPreview({ variant="tertiary" key={idx} className={`${styles.gridTile} ${selected || hoverTile === idx ? styles.gridTileSelected : ""} ${hoverTile === idx ? styles.gridTileHovered : ""}`} - onClick={() => - onParameterChange( - "position", - idx as AddPageNumbersParameters["position"], - ) - } + onClick={() => onParameterChange("position", idx)} onMouseEnter={() => setHoverTile(idx)} onMouseLeave={() => setHoverTile(null)} style={{ diff --git a/frontend/editor/src/core/components/tools/addWatermark/WatermarkStyleSettings.tsx b/frontend/editor/src/core/components/tools/addWatermark/WatermarkStyleSettings.tsx index 1d9dad2995..c9ce1ca1bd 100644 --- a/frontend/editor/src/core/components/tools/addWatermark/WatermarkStyleSettings.tsx +++ b/frontend/editor/src/core/components/tools/addWatermark/WatermarkStyleSettings.tsx @@ -36,9 +36,7 @@ const WatermarkStyleSettings = ({ onChange={(value) => onParameterChange( "rotation", - typeof value === "number" - ? value - : parseInt(value as string, 10) || 0, + typeof value === "number" ? value : parseInt(value, 10) || 0, ) } min={-360} @@ -55,9 +53,7 @@ const WatermarkStyleSettings = ({ onChange={(value) => onParameterChange( "opacity", - typeof value === "number" - ? value - : parseInt(value as string, 10) || 50, + typeof value === "number" ? value : parseInt(value, 10) || 50, ) } min={0} @@ -77,9 +73,7 @@ const WatermarkStyleSettings = ({ onChange={(value) => onParameterChange( "widthSpacer", - typeof value === "number" - ? value - : parseInt(value as string, 10) || 50, + typeof value === "number" ? value : parseInt(value, 10) || 50, ) } min={0} @@ -96,9 +90,7 @@ const WatermarkStyleSettings = ({ onChange={(value) => onParameterChange( "heightSpacer", - typeof value === "number" - ? value - : parseInt(value as string, 10) || 50, + typeof value === "number" ? value : parseInt(value, 10) || 50, ) } min={0} diff --git a/frontend/editor/src/core/components/tools/adjustPageScale/AdjustPageScaleSettings.tsx b/frontend/editor/src/core/components/tools/adjustPageScale/AdjustPageScaleSettings.tsx index aeb874b58e..e2bf0a8466 100644 --- a/frontend/editor/src/core/components/tools/adjustPageScale/AdjustPageScaleSettings.tsx +++ b/frontend/editor/src/core/components/tools/adjustPageScale/AdjustPageScaleSettings.tsx @@ -103,9 +103,7 @@ const AdjustPageScaleSettings = ({ - onParameterChange("orientation", value as Orientation) - } + onChange={(value) => onParameterChange("orientation", value)} options={orientationOptions} fullWidth /> diff --git a/frontend/editor/src/core/components/tools/certSign/WetSignatureInput.tsx b/frontend/editor/src/core/components/tools/certSign/WetSignatureInput.tsx index f87fda19fe..af1913baa7 100644 --- a/frontend/editor/src/core/components/tools/certSign/WetSignatureInput.tsx +++ b/frontend/editor/src/core/components/tools/certSign/WetSignatureInput.tsx @@ -238,9 +238,7 @@ const WetSignatureInput = ({ - handleSignatureTypeChange(value as SignatureType) - } + onChange={(value) => handleSignatureTypeChange(value)} options={[ { label: t("sign.type.canvas", "Draw"), value: "canvas", disabled }, { label: t("sign.type.image", "Upload"), value: "image", disabled }, diff --git a/frontend/editor/src/core/components/tools/compare/ComparePixelWorkbenchView.tsx b/frontend/editor/src/core/components/tools/compare/ComparePixelWorkbenchView.tsx index d45ccd75a0..35b3a7e0f4 100644 --- a/frontend/editor/src/core/components/tools/compare/ComparePixelWorkbenchView.tsx +++ b/frontend/editor/src/core/components/tools/compare/ComparePixelWorkbenchView.tsx @@ -170,7 +170,7 @@ const ComparePixelWorkbenchView = ({ setViewMode(value as PixelViewMode)} + onChange={(value) => setViewMode(value)} options={[ { value: "side-by-side", diff --git a/frontend/editor/src/core/components/tools/compare/CompareWorkbenchView.tsx b/frontend/editor/src/core/components/tools/compare/CompareWorkbenchView.tsx index 1df0f1c14a..5470e3ac8c 100644 --- a/frontend/editor/src/core/components/tools/compare/CompareWorkbenchView.tsx +++ b/frontend/editor/src/core/components/tools/compare/CompareWorkbenchView.tsx @@ -28,7 +28,6 @@ import { updateToastProgress, dismissToast, } from "@app/components/toast"; -import type { ToastLocation } from "@app/components/toast/types"; interface CompareWorkbenchViewProps { data: CompareWorkbenchData | null; @@ -323,7 +322,7 @@ const CompareTextWorkbenchView = ({ data }: CompareTextWorkbenchViewProps) => { "At least one of these PDFs are very large, scrolling won't be smooth until the rendering is complete", ), body: `${countsText} ${t("compare.rendering.pagesRendered", "pages rendered")}`, - location: "bottom-right" as ToastLocation, + location: "bottom-right", isPersistentPopup: true, durationMs: 0, expandable: false, @@ -337,7 +336,7 @@ const CompareTextWorkbenchView = ({ data }: CompareTextWorkbenchViewProps) => { "At least one of these PDFs are very large, scrolling won't be smooth until the rendering is complete", ), body: `${countsText} ${t("compare.rendering.pagesRendered", "pages rendered")}`, - location: "bottom-right" as ToastLocation, + location: "bottom-right", isPersistentPopup: true, alertType: "neutral", // ensure it stays neutral until completion }); @@ -452,7 +451,7 @@ const CompareTextWorkbenchView = ({ data }: CompareTextWorkbenchViewProps) => { "compare.rendering.pageNotReadyBody", "Some pages are still rendering. Navigation will snap once they are ready.", ), - location: "bottom-right" as ToastLocation, + location: "bottom-right", isPersistentPopup: false, durationMs: 2500, }); diff --git a/frontend/editor/src/core/components/tools/compare/compare.ts b/frontend/editor/src/core/components/tools/compare/compare.ts index 30d0c42304..b157745307 100644 --- a/frontend/editor/src/core/components/tools/compare/compare.ts +++ b/frontend/editor/src/core/components/tools/compare/compare.ts @@ -186,7 +186,7 @@ export const getFileFromSelection = ( ): StirlingFile | null => { if (explicit) return explicit; if (!fileId) return null; - return (selectors.getFile(fileId) as StirlingFile | undefined | null) ?? null; + return selectors.getFile(fileId) ?? null; }; export const getStubFromSelection = ( diff --git a/frontend/editor/src/core/components/tools/compare/hooks/useCompareChangeNavigation.ts b/frontend/editor/src/core/components/tools/compare/hooks/useCompareChangeNavigation.ts index d7d8e95635..e56187f5f2 100644 --- a/frontend/editor/src/core/components/tools/compare/hooks/useCompareChangeNavigation.ts +++ b/frontend/editor/src/core/components/tools/compare/hooks/useCompareChangeNavigation.ts @@ -79,7 +79,7 @@ export const useCompareChangeNavigation = ( const inner = anchor.closest( ".compare-diff-page__inner", ) as HTMLElement | null; - const topPercent = parseFloat((anchor as HTMLElement).style.top || "0"); + const topPercent = parseFloat(anchor.style.top || "0"); if (pageEl && inner && !Number.isNaN(topPercent)) { const innerRect = inner.getBoundingClientRect(); const innerHeight = Math.max(1, innerRect.height); @@ -156,9 +156,7 @@ export const useCompareChangeNavigation = ( ".compare-diff-page", ) as HTMLElement | null; const pageNumAttr = pageEl?.getAttribute("data-page-number"); - const topPercent = parseFloat( - (anchor as HTMLElement).style.top || "0", - ); + const topPercent = parseFloat(anchor.style.top || "0"); if (pageNumAttr) { const peerPageEl = peer.querySelector( `.compare-diff-page[data-page-number="${pageNumAttr}"]`, diff --git a/frontend/editor/src/core/components/tools/compare/hooks/useComparePanZoom.ts b/frontend/editor/src/core/components/tools/compare/hooks/useComparePanZoom.ts index bac47de952..d44c55e1ec 100644 --- a/frontend/editor/src/core/components/tools/compare/hooks/useComparePanZoom.ts +++ b/frontend/editor/src/core/components/tools/compare/hooks/useComparePanZoom.ts @@ -323,7 +323,7 @@ export const useComparePanZoom = ({ const pages = getPagesForPane(pane); const rotation = pages[0]?.rotation ?? 0; const normalized = ((rotation % 360) + 360) % 360; - return normalized as 0 | 90 | 180 | 270 | number; + return normalized; }, [getPagesForPane], ); @@ -656,7 +656,7 @@ export const useComparePanZoom = ({ }; edgeOverscrollRef.current[pane] = 0; lastActivePaneRef.current = pane; - (container as HTMLDivElement).style.cursor = "grabbing"; + container.style.cursor = "grabbing"; }, [isPanMode, baseZoom, comparisonZoom, basePan, comparisonPan], ); @@ -700,11 +700,7 @@ export const useComparePanZoom = ({ : comparisonScrollRef.current; if (sourceEl) { const zoom = drag.source === "base" ? baseZoom : comparisonZoom; - (sourceEl as HTMLDivElement).style.cursor = isPanMode - ? zoom > 1 - ? "grab" - : "auto" - : ""; + sourceEl.style.cursor = isPanMode ? (zoom > 1 ? "grab" : "auto") : ""; } panDragRef.current.active = false; panDragRef.current.source = null; diff --git a/frontend/editor/src/core/components/tools/compare/hooks/useCompareWorkbenchBarButtons.tsx b/frontend/editor/src/core/components/tools/compare/hooks/useCompareWorkbenchBarButtons.tsx index 3ddbbbf3da..076ac877d5 100644 --- a/frontend/editor/src/core/components/tools/compare/hooks/useCompareWorkbenchBarButtons.tsx +++ b/frontend/editor/src/core/components/tools/compare/hooks/useCompareWorkbenchBarButtons.tsx @@ -3,7 +3,6 @@ import type React from "react"; import { useTranslation } from "react-i18next"; import LocalIcon from "@app/components/shared/LocalIcon"; import { alert } from "@app/components/toast"; -import type { ToastLocation } from "@app/components/toast/types"; import type { WorkbenchBarButtonWithAction } from "@app/hooks/useWorkbenchBarButtons"; import { useIsMobile } from "@app/hooks/useIsMobile"; @@ -179,7 +178,7 @@ export const useCompareWorkbenchBarButtons = ({ "Tip: Arrow Up/Down scroll both panes when unlinked is off.", ), durationMs: 5000, - location: "bottom-center" as ToastLocation, + location: "bottom-center", expandable: false, }); } diff --git a/frontend/editor/src/core/components/tools/fullscreen/DetailedToolItem.stories.tsx b/frontend/editor/src/core/components/tools/fullscreen/DetailedToolItem.stories.tsx index cd443e248a..901824aaf6 100644 --- a/frontend/editor/src/core/components/tools/fullscreen/DetailedToolItem.stories.tsx +++ b/frontend/editor/src/core/components/tools/fullscreen/DetailedToolItem.stories.tsx @@ -94,10 +94,10 @@ type Story = StoryObj; /** An available tool rendered in its default, unselected state. */ export const Default: Story = { - render: () => , + render: () => , }; /** The active tool in the panel — highlighted selected state. */ export const Selected: Story = { - render: () => , + render: () => , }; diff --git a/frontend/editor/src/core/components/tools/overlayPdfs/OverlayPdfsSettings.tsx b/frontend/editor/src/core/components/tools/overlayPdfs/OverlayPdfsSettings.tsx index e7246bb4e3..8df455182e 100644 --- a/frontend/editor/src/core/components/tools/overlayPdfs/OverlayPdfsSettings.tsx +++ b/frontend/editor/src/core/components/tools/overlayPdfs/OverlayPdfsSettings.tsx @@ -137,7 +137,7 @@ export default function OverlayPdfsSettings({ - onParameterChange("overlayPosition", (v === "1" ? 1 : 0) as 0 | 1) + onParameterChange("overlayPosition", v === "1" ? 1 : 0) } options={[ { diff --git a/frontend/editor/src/core/components/tools/pdfTextEditor/PdfTextEditorSidebar.tsx b/frontend/editor/src/core/components/tools/pdfTextEditor/PdfTextEditorSidebar.tsx index 1892aaa7f3..a0ce9fc362 100644 --- a/frontend/editor/src/core/components/tools/pdfTextEditor/PdfTextEditorSidebar.tsx +++ b/frontend/editor/src/core/components/tools/pdfTextEditor/PdfTextEditorSidebar.tsx @@ -279,9 +279,7 @@ const PdfTextEditorSidebar = ({ data }: PdfTextEditorSidebarProps) => { - handleModeChangeRequest(value as GroupingMode) - } + onChange={(value) => handleModeChangeRequest(value)} options={[ { label: t("pdfTextEditor.groupingMode.auto", "Auto"), diff --git a/frontend/editor/src/core/components/tools/shared/ReviewToolStep.tsx b/frontend/editor/src/core/components/tools/shared/ReviewToolStep.tsx index 7918bac7ca..ef596c2a0d 100644 --- a/frontend/editor/src/core/components/tools/shared/ReviewToolStep.tsx +++ b/frontend/editor/src/core/components/tools/shared/ReviewToolStep.tsx @@ -12,7 +12,6 @@ import { useFileActionTerminology } from "@app/hooks/useFileActionTerminology"; import { useFileActionIcons } from "@app/hooks/useFileActionIcons"; import { saveOperationResults } from "@app/services/operationResultsSaveService"; import { useFileActions, useFileSelectors } from "@app/contexts/FileContext"; -import { FileId } from "@app/types/fileContext"; import i18n from "@app/i18n"; export interface ReviewToolStepProps { @@ -65,11 +64,11 @@ function ReviewStepContent({ downloadFilename: operation.downloadFilename || "download", downloadLocalPath: operation.downloadLocalPath, outputFileIds: operation.outputFileIds, - getFile: (fileId) => selectors.getFile(fileId as FileId), - getStub: (fileId) => selectors.getStirlingFileStub(fileId as FileId), + getFile: (fileId) => selectors.getFile(fileId), + getStub: (fileId) => selectors.getStirlingFileStub(fileId), markSaved: (fileId, savedPath) => { - const stub = selectors.getStirlingFileStub(fileId as FileId); - fileActions.updateStirlingFileStub(fileId as FileId, { + const stub = selectors.getStirlingFileStub(fileId); + fileActions.updateStirlingFileStub(fileId, { localFilePath: stub?.localFilePath ?? savedPath, isDirty: false, }); diff --git a/frontend/editor/src/core/components/tools/showJS/utils.ts b/frontend/editor/src/core/components/tools/showJS/utils.ts index e946ec271e..7c6530c21b 100644 --- a/frontend/editor/src/core/components/tools/showJS/utils.ts +++ b/frontend/editor/src/core/components/tools/showJS/utils.ts @@ -186,7 +186,7 @@ export function tokenizeToLines( } if (isStringDelimiter) { - startString(ch as '"' | "'" | "`"); + startString(ch); continue; } @@ -312,7 +312,7 @@ export function computeBlocks( continue; } if (isStringDelimiter) { - startString(ch as '"' | "'" | "`"); + startString(ch); continue; } if (isOpenBrace) { diff --git a/frontend/editor/src/core/components/tools/sign/MobileSignatureModal.test.tsx b/frontend/editor/src/core/components/tools/sign/MobileSignatureModal.test.tsx index c8607d55c4..4f68e7c68c 100644 --- a/frontend/editor/src/core/components/tools/sign/MobileSignatureModal.test.tsx +++ b/frontend/editor/src/core/components/tools/sign/MobileSignatureModal.test.tsx @@ -52,9 +52,9 @@ function primeSession( mockedApi.post.mockResolvedValue({ status: 200, data: SESSION_INFO, - } as never); - mockedApi.delete.mockResolvedValue({ status: 200 } as never); - mockedApi.get.mockImplementation(((url: string, config?: unknown) => { + }); + mockedApi.delete.mockResolvedValue({ status: 200 }); + mockedApi.get.mockImplementation((url: string, config?: unknown) => { if (url.includes("/files/")) { return Promise.resolve({ status: 200, data: { files } } as never); } @@ -70,7 +70,7 @@ function primeSession( } as never); } return Promise.reject(new Error(`unexpected GET ${url}`)); - }) as never); + }); } function renderModal( diff --git a/frontend/editor/src/core/components/tools/sign/SignSettings.tsx b/frontend/editor/src/core/components/tools/sign/SignSettings.tsx index 4aa9f8ffd3..1d78343c79 100644 --- a/frontend/editor/src/core/components/tools/sign/SignSettings.tsx +++ b/frontend/editor/src/core/components/tools/sign/SignSettings.tsx @@ -519,7 +519,7 @@ const SignSettings = ({ return; } const nextSource = allowedSignatureSources.includes( - parameters.signatureType as SignatureSource, + parameters.signatureType, ) ? (parameters.signatureType as SignatureSource) : effectiveDefaultSource; @@ -1282,9 +1282,7 @@ const SignSettings = ({ - handleSignatureSourceChange(value as SignatureSource) - } + onChange={(value) => handleSignatureSourceChange(value)} options={sourceOptions} /> )} diff --git a/frontend/editor/src/core/components/tools/toolPicker/ToolButton.tsx b/frontend/editor/src/core/components/tools/toolPicker/ToolButton.tsx index 4792fd721a..8daf2cb019 100644 --- a/frontend/editor/src/core/components/tools/toolPicker/ToolButton.tsx +++ b/frontend/editor/src/core/components/tools/toolPicker/ToolButton.tsx @@ -74,7 +74,7 @@ const ToolButton: React.FC = ({ const { hotkeys } = useHotkeys(); const binding = hotkeys[id]; const { getToolNavigation } = useToolNavigation(); - const fav = isFavorite(id as ToolId); + const fav = isFavorite(id); // Check if this tool will route to SaaS backend (desktop only) const rawEndpoint = tool.operationConfig?.endpoint; @@ -308,7 +308,7 @@ const ToolButton: React.FC = ({ hasStars && !visuallyUnavailable ? ( toggleFavorite(id as ToolId)} + onToggle={() => toggleFavorite(id)} className="tool-button-star" size="xs" /> diff --git a/frontend/editor/src/core/components/tools/validateSignature/ValidateSignatureResults.tsx b/frontend/editor/src/core/components/tools/validateSignature/ValidateSignatureResults.tsx index 22020ac6dc..23a9d9e949 100644 --- a/frontend/editor/src/core/components/tools/validateSignature/ValidateSignatureResults.tsx +++ b/frontend/editor/src/core/components/tools/validateSignature/ValidateSignatureResults.tsx @@ -294,7 +294,7 @@ const ValidateSignatureResults = ({ setSelectedType(v as "pdf" | "csv" | "json")} + onChange={(v) => setSelectedType(v)} options={downloadTypeOptions} />
{v.endpoints.map((e) => (
- + {e.endpoint} {e.name} diff --git a/frontend/editor/src/portal/components/pipelines/PipelineStepSettings.test.tsx b/frontend/editor/src/portal/components/pipelines/PipelineStepSettings.test.tsx index 0b15b7233a..0850499a99 100644 --- a/frontend/editor/src/portal/components/pipelines/PipelineStepSettings.test.tsx +++ b/frontend/editor/src/portal/components/pipelines/PipelineStepSettings.test.tsx @@ -275,8 +275,7 @@ describe("PipelineStepSettings: every tool's settings render in the portal", () const Settings = entry.automationSettings as ComponentType< ToolAutomationSettingsProps >; - const params = (entry.operationConfig?.defaultParameters ?? - {}) as ErasedToolParams; + const params = entry.operationConfig?.defaultParameters ?? {}; const caught: { error: Error | null } = { error: null }; // The sentinel sibling commits only once the lazy Settings actually renders, so we wait for a diff --git a/frontend/editor/src/portal/components/policies/PolicySetupWizard.tsx b/frontend/editor/src/portal/components/policies/PolicySetupWizard.tsx index b50e2efe12..cccdb36e40 100644 --- a/frontend/editor/src/portal/components/policies/PolicySetupWizard.tsx +++ b/frontend/editor/src/portal/components/policies/PolicySetupWizard.tsx @@ -457,7 +457,7 @@ function PolicySetupWizardBody({ variant="underline" ariaLabel={t("portal.policies.wizard.tabs.ariaLabel")} activeKey={step} - onChange={(k) => setStep(k as Step)} + onChange={(k) => setStep(k)} items={[ { key: "workflow", label: t("portal.policies.wizard.tabs.workflow") }, { key: "settings", label: t("portal.policies.wizard.tabs.settings") }, diff --git a/frontend/editor/src/portal/components/processor-flow/useFlowParticles.ts b/frontend/editor/src/portal/components/processor-flow/useFlowParticles.ts index 65fc6cc9ad..a32ea76a4d 100644 --- a/frontend/editor/src/portal/components/processor-flow/useFlowParticles.ts +++ b/frontend/editor/src/portal/components/processor-flow/useFlowParticles.ts @@ -134,10 +134,7 @@ export function useFlowParticles({ for (let i = 0; i < meanInterval.length; i++) { if (!Number.isFinite(meanInterval[i]) || !g.srcs[i]) continue; if (now >= nextEmit[i] && particles.length < MAX_PARTICLES) { - const c = document.createElementNS( - NS, - "circle", - ) as SVGCircleElement; + const c = document.createElementNS(NS, "circle"); c.setAttribute("r", "2.5"); c.setAttribute("opacity", "0.75"); c.style.fill = "var(--c-primary)"; diff --git a/frontend/editor/src/portal/mocks/handlers/policies.ts b/frontend/editor/src/portal/mocks/handlers/policies.ts index 1bfc435d4c..ce6c041ae9 100644 --- a/frontend/editor/src/portal/mocks/handlers/policies.ts +++ b/frontend/editor/src/portal/mocks/handlers/policies.ts @@ -35,7 +35,7 @@ function nextId(categoryId: string): string { } function categoryId(wire: WirePolicy): string { - return (wire.output?.options?.categoryId as string | undefined) ?? ""; + return wire.output?.options?.categoryId ?? ""; } export const policiesHandlers = [ diff --git a/frontend/editor/src/portal/mocks/handlers/procurementSaas.ts b/frontend/editor/src/portal/mocks/handlers/procurementSaas.ts index fe75827c2d..2f5246ce8d 100644 --- a/frontend/editor/src/portal/mocks/handlers/procurementSaas.ts +++ b/frontend/editor/src/portal/mocks/handlers/procurementSaas.ts @@ -256,7 +256,7 @@ export const procurementSaasHandlers = [ stage: "quote", licensed: true, latestQuote: quote, - } as never; + }; return HttpResponse.json(quote); }), http.post(`${SAAS}/api/v1/procurement/trial/extend`, () => { diff --git a/frontend/editor/src/portal/queries/adapters.ts b/frontend/editor/src/portal/queries/adapters.ts index 083e396bad..3cb091d8cd 100644 --- a/frontend/editor/src/portal/queries/adapters.ts +++ b/frontend/editor/src/portal/queries/adapters.ts @@ -11,6 +11,6 @@ export function toAsyncState(query: UseQueryResult): AsyncState { return { data: query.data ?? null, loading: query.isPending, - error: (query.error as Error | null) ?? null, + error: query.error ?? null, }; } diff --git a/frontend/editor/src/portal/setupTests.ts b/frontend/editor/src/portal/setupTests.ts index 7de4f9f309..22d95aa1ab 100644 --- a/frontend/editor/src/portal/setupTests.ts +++ b/frontend/editor/src/portal/setupTests.ts @@ -50,7 +50,7 @@ global.IntersectionObserver = vi.fn().mockImplementation(() => ({ observe: vi.fn(), unobserve: vi.fn(), disconnect: vi.fn(), -})) as unknown as typeof IntersectionObserver; +})); Object.defineProperty(window, "matchMedia", { writable: true, diff --git a/frontend/editor/src/proprietary/auth/springAuthClient.test.ts b/frontend/editor/src/proprietary/auth/springAuthClient.test.ts index 54fed2028d..13f5c6d651 100644 --- a/frontend/editor/src/proprietary/auth/springAuthClient.test.ts +++ b/frontend/editor/src/proprietary/auth/springAuthClient.test.ts @@ -12,11 +12,7 @@ import apiClient from "@app/services/apiClient"; // + oauthNavigation seam, so springAuth routes through the mocks below. import "@app/auth/configureSpringAuth"; import { allowConsole, expectConsole } from "@app/tests/failOnConsole"; -import { - AxiosError, - type AxiosResponse, - type InternalAxiosRequestConfig, -} from "axios"; +import { AxiosError, type InternalAxiosRequestConfig } from "axios"; // Mock apiClient vi.mock("@app/services/apiClient"); @@ -59,7 +55,7 @@ describe("SpringAuthClient", () => { vi.mocked(apiClient.get).mockResolvedValueOnce({ status: 200, data: { user: mockUser }, - } as unknown as AxiosResponse); + }); const result = await springAuth.getSession(); @@ -176,7 +172,7 @@ describe("SpringAuthClient", () => { expires_in: 3600, }, }, - } as unknown as AxiosResponse); + }); // Spy on window.dispatchEvent const dispatchEventSpy = vi.spyOn(window, "dispatchEvent"); @@ -235,7 +231,7 @@ describe("SpringAuthClient", () => { vi.mocked(apiClient.post).mockResolvedValueOnce({ status: 200, data: {}, - } as unknown as AxiosResponse); + }); const result = await springAuth.signOut(); @@ -288,7 +284,7 @@ describe("SpringAuthClient", () => { expires_in: 3600, }, }, - } as unknown as AxiosResponse); + }); const result = await springAuth.refreshSession(); @@ -375,7 +371,7 @@ describe("SpringAuthClient", () => { expect(isSafePostLoginRedirect("")).toBe(false); expect(isSafePostLoginRedirect(null)).toBe(false); expect(isSafePostLoginRedirect(undefined)).toBe(false); - expect(isSafePostLoginRedirect(42 as unknown)).toBe(false); + expect(isSafePostLoginRedirect(42)).toBe(false); }); it("rejects protocol-relative and absolute URLs (open-redirect guard)", () => { diff --git a/frontend/editor/src/proprietary/auth/supabase/UseSession.tsx b/frontend/editor/src/proprietary/auth/supabase/UseSession.tsx index 6bcc6b501e..385f3f4e35 100644 --- a/frontend/editor/src/proprietary/auth/supabase/UseSession.tsx +++ b/frontend/editor/src/proprietary/auth/supabase/UseSession.tsx @@ -46,7 +46,7 @@ function mapUser(user: SbUser): AuthUser { "", role: readRole(user), is_anonymous: user.is_anonymous, - app_metadata: user.app_metadata as Record, + app_metadata: user.app_metadata, }; } diff --git a/frontend/editor/src/proprietary/components/policies/policyRunSettles.test.ts b/frontend/editor/src/proprietary/components/policies/policyRunSettles.test.ts index fdce331821..c3c6be7137 100644 --- a/frontend/editor/src/proprietary/components/policies/policyRunSettles.test.ts +++ b/frontend/editor/src/proprietary/components/policies/policyRunSettles.test.ts @@ -7,20 +7,19 @@ import type { PolicyRunRecord } from "@app/components/policies/policyRunStore"; * effect used to skip those runs entirely, so `imported` never flipped and the * file's badge + blocking overlay spun forever - on every engine. */ -const run = (overrides: Partial = {}): PolicyRunRecord => - ({ - runId: "r", - categoryId: "security", - fileId: "f", - fileName: "f.pdf", - fileSize: 1, - target: "saas", - status: "COMPLETED", - outputs: [], - error: null, - startedAt: 0, - ...overrides, - }) as PolicyRunRecord; +const run = (overrides: Partial = {}): PolicyRunRecord => ({ + runId: "r", + categoryId: "security", + fileId: "f", + fileName: "f.pdf", + fileSize: 1, + target: "saas", + status: "COMPLETED", + outputs: [], + error: null, + startedAt: 0, + ...overrides, +}); describe("finishedWithNothingToDeliver", () => { it("settles a completed run that produced no output", () => { diff --git a/frontend/editor/src/proprietary/components/policies/useClientSideClassification.ts b/frontend/editor/src/proprietary/components/policies/useClientSideClassification.ts index 64fd849d87..ede1768b2a 100644 --- a/frontend/editor/src/proprietary/components/policies/useClientSideClassification.ts +++ b/frontend/editor/src/proprietary/components/policies/useClientSideClassification.ts @@ -99,7 +99,7 @@ export function useClientSideClassification(): void { if (claimed.current.has(key)) continue; claimed.current.add(key); const verdict = await classifyStub( - stub.id as FileId, + stub.id, stub.name, stub.size ?? 0, ); @@ -108,11 +108,11 @@ export function useClientSideClassification(): void { if (verdict == null) continue; // Deliver unconditionally - a re-render must never discard a computed // (and already metered) result. Writes are idempotent. - updateStirlingFileStub(stub.id as FileId, { + updateStirlingFileStub(stub.id, { classificationLabels: verdict.labels, classificationConfidence: verdict.confidence, }); - const ok = await fileStorage.updateFileMetadata(stub.id as FileId, { + const ok = await fileStorage.updateFileMetadata(stub.id, { classificationLabels: verdict.labels, classificationConfidence: verdict.confidence, }); diff --git a/frontend/editor/src/proprietary/components/policies/usePolicyAutoRun.ts b/frontend/editor/src/proprietary/components/policies/usePolicyAutoRun.ts index 936fef8119..0638b1432c 100644 --- a/frontend/editor/src/proprietary/components/policies/usePolicyAutoRun.ts +++ b/frontend/editor/src/proprietary/components/policies/usePolicyAutoRun.ts @@ -768,7 +768,7 @@ async function importOutputs( // Mark the outputs handled BEFORE adding them (belt-and-suspenders session // guard on top of derivedFromTool) so the auto-run never enforces the policy // on its own output — that would version endlessly in a loop. - for (const s of categorized) markHandled(s.id as string); + for (const s of categorized) markHandled(s.id); deliveredIds = categorized.map((s) => s.id as string); if (ctx.parentStub) { // Input is in the active workspace: version it in place, silently — the @@ -799,7 +799,7 @@ async function importOutputs( derivedFromTool: true, }); // Belt-and-suspenders session guard on top of derivedFromTool. - for (const f of added) markHandled(f.fileId as string); + for (const f of added) markHandled(f.fileId); deliveredIds = added.map((f) => f.fileId as string); // Mark each new-file output as tool-derived (the versioned path gets this from the // CONSUME_FILES reducer; the addFiles path doesn't). This is the real loop guard: the dispatch diff --git a/frontend/editor/src/proprietary/components/shared/FileSidebarGroupControls.tsx b/frontend/editor/src/proprietary/components/shared/FileSidebarGroupControls.tsx index 41d1358594..1b37a13bb7 100644 --- a/frontend/editor/src/proprietary/components/shared/FileSidebarGroupControls.tsx +++ b/frontend/editor/src/proprietary/components/shared/FileSidebarGroupControls.tsx @@ -46,7 +46,7 @@ export function FileSidebarGroupControls({ const ids = new Set(); for (const key of category.labelKeys) { for (const stub of byLabel.get(key)?.stubs ?? []) { - ids.add(stub.id as string); + ids.add(stub.id); } } counts.set(category.id, ids.size); diff --git a/frontend/editor/src/proprietary/components/shared/InviteMembersModal.tsx b/frontend/editor/src/proprietary/components/shared/InviteMembersModal.tsx index e57f60395f..063fb1c4ef 100644 --- a/frontend/editor/src/proprietary/components/shared/InviteMembersModal.tsx +++ b/frontend/editor/src/proprietary/components/shared/InviteMembersModal.tsx @@ -460,7 +460,7 @@ export default function InviteMembersModal({ { - setInviteMode(value as "email" | "direct" | "link"); + setInviteMode(value); setGeneratedInviteLink(null); }} options={[ diff --git a/frontend/editor/src/proprietary/components/shared/UpgradeBanner.tsx b/frontend/editor/src/proprietary/components/shared/UpgradeBanner.tsx index 365c64a030..fdb92dc271 100644 --- a/frontend/editor/src/proprietary/components/shared/UpgradeBanner.tsx +++ b/frontend/editor/src/proprietary/components/shared/UpgradeBanner.tsx @@ -67,15 +67,9 @@ const UpgradeBanner: React.FC = () => { } }; - window.addEventListener( - UPGRADE_BANNER_TEST_EVENT, - handleTestEvent as EventListener, - ); + window.addEventListener(UPGRADE_BANNER_TEST_EVENT, handleTestEvent); return () => { - window.removeEventListener( - UPGRADE_BANNER_TEST_EVENT, - handleTestEvent as EventListener, - ); + window.removeEventListener(UPGRADE_BANNER_TEST_EVENT, handleTestEvent); }; }, [isDev]); diff --git a/frontend/editor/src/proprietary/components/shared/config/LoginLandingSetting.test.tsx b/frontend/editor/src/proprietary/components/shared/config/LoginLandingSetting.test.tsx index 31d45c0d45..b9caf6ba8d 100644 --- a/frontend/editor/src/proprietary/components/shared/config/LoginLandingSetting.test.tsx +++ b/frontend/editor/src/proprietary/components/shared/config/LoginLandingSetting.test.tsx @@ -3,7 +3,7 @@ import { render, screen, waitFor } from "@testing-library/react"; import { MantineProvider } from "@mantine/core"; const h = vi.hoisted(() => ({ - prefs: { loginLandingView: "processor" as "processor" | "editor" }, + prefs: { loginLandingView: "processor" }, update: vi.fn(), get: vi.fn(), })); diff --git a/frontend/editor/src/proprietary/components/shared/config/configSections/AdminConnectionsSection.tsx b/frontend/editor/src/proprietary/components/shared/config/configSections/AdminConnectionsSection.tsx index f788551551..b993889e52 100644 --- a/frontend/editor/src/proprietary/components/shared/config/configSections/AdminConnectionsSection.tsx +++ b/frontend/editor/src/proprietary/components/shared/config/configSections/AdminConnectionsSection.tsx @@ -518,11 +518,11 @@ export default function AdminConnectionsSection() { updatedSettings: Record, ) => { if (provider.id === "smtp") { - setSettings({ ...settings, mail: updatedSettings as MailSettings }); + setSettings({ ...settings, mail: updatedSettings }); } else if (provider.id === "telegram") { setSettings({ ...settings, - telegram: updatedSettings as TelegramSettingsData, + telegram: updatedSettings, }); } else if (provider.id === "googledrive") { const gd = updatedSettings as GoogleDriveSettings; @@ -534,7 +534,7 @@ export default function AdminConnectionsSection() { googleDriveAppId: gd.appId, }); } else if (provider.id === "saml2") { - setSettings({ ...settings, saml2: updatedSettings as Saml2Settings }); + setSettings({ ...settings, saml2: updatedSettings }); } else if (provider.id === "oauth2-generic") { const generic = updatedSettings as OAuth2GenericSettings; setSettings({ ...settings, oauth2: { ...settings.oauth2, ...generic } }); diff --git a/frontend/editor/src/proprietary/components/shared/config/configSections/AdminUsageSection.tsx b/frontend/editor/src/proprietary/components/shared/config/configSections/AdminUsageSection.tsx index 6b46789bdd..d0a0a1b2e9 100644 --- a/frontend/editor/src/proprietary/components/shared/config/configSections/AdminUsageSection.tsx +++ b/frontend/editor/src/proprietary/components/shared/config/configSections/AdminUsageSection.tsx @@ -332,9 +332,7 @@ const AdminUsageSection: React.FC = () => { - setDisplayMode(value as "top10" | "top20" | "all") - } + onChange={(value) => setDisplayMode(value)} options={[ { value: "top10", @@ -373,7 +371,7 @@ const AdminUsageSection: React.FC = () => { setDataType(value as "all" | "api" | "ui")} + onChange={(value) => setDataType(value)} options={[ { value: "all", diff --git a/frontend/editor/src/proprietary/components/shared/config/configSections/audit/AuditEventsTable.tsx b/frontend/editor/src/proprietary/components/shared/config/configSections/audit/AuditEventsTable.tsx index feca3696d4..22263596c0 100644 --- a/frontend/editor/src/proprietary/components/shared/config/configSections/audit/AuditEventsTable.tsx +++ b/frontend/editor/src/proprietary/components/shared/config/configSections/audit/AuditEventsTable.tsx @@ -257,11 +257,9 @@ const AuditEventsTable: React.FC = ({ verticalSpacing="sm" withRowBorders highlightOnHover - style={ - { - "--table-border-color": "var(--mantine-color-gray-3)", - } as React.CSSProperties - } + style={{ + "--table-border-color": "var(--mantine-color-gray-3)", + }} > = ({ { - setInputMethod(value as "text" | "file"); + setInputMethod(value); // Clear opposite input when switching if (value === "text") setLicenseFile(null); if (value === "file") setLicenseKeyInput(""); diff --git a/frontend/editor/src/proprietary/components/shared/config/configSections/usage/UsageAnalyticsTable.tsx b/frontend/editor/src/proprietary/components/shared/config/configSections/usage/UsageAnalyticsTable.tsx index f27d5d09a3..a89cb477e3 100644 --- a/frontend/editor/src/proprietary/components/shared/config/configSections/usage/UsageAnalyticsTable.tsx +++ b/frontend/editor/src/proprietary/components/shared/config/configSections/usage/UsageAnalyticsTable.tsx @@ -32,11 +32,9 @@ const UsageAnalyticsTable: React.FC = ({ data }) => { verticalSpacing="sm" withRowBorders highlightOnHover - style={ - { - "--table-border-color": "var(--mantine-color-gray-3)", - } as React.CSSProperties - } + style={{ + "--table-border-color": "var(--mantine-color-gray-3)", + }} > diff --git a/frontend/editor/src/proprietary/components/shared/fileSidebarGrouping.tsx b/frontend/editor/src/proprietary/components/shared/fileSidebarGrouping.tsx index baf3d812cb..447bd19a68 100644 --- a/frontend/editor/src/proprietary/components/shared/fileSidebarGrouping.tsx +++ b/frontend/editor/src/proprietary/components/shared/fileSidebarGrouping.tsx @@ -20,7 +20,6 @@ import { } from "@app/services/fileSidebarCategories"; import { buildLabelGroups } from "@app/components/shared/fileSidebarGroupingLogic"; import { scheduleIdle } from "@app/utils/scheduleIdle"; -import type { FileId } from "@app/types/file"; import type { StirlingFileStub } from "@app/types/fileContext"; import type { FileSidebarGroup } from "@core/components/shared/fileSidebarGrouping"; @@ -81,7 +80,7 @@ export function useFileSidebarGroups( if (cancelled) return; attempted.current.add(attemptKey(stub)); if (labels) { - const ok = await fileStorage.updateFileMetadata(stub.id as FileId, { + const ok = await fileStorage.updateFileMetadata(stub.id, { classificationLabels: labels, }); if (ok) wrote = true; diff --git a/frontend/editor/src/proprietary/components/shared/fileSidebarGroupingLogic.ts b/frontend/editor/src/proprietary/components/shared/fileSidebarGroupingLogic.ts index 82569a9bd5..5b4b30ce33 100644 --- a/frontend/editor/src/proprietary/components/shared/fileSidebarGroupingLogic.ts +++ b/frontend/editor/src/proprietary/components/shared/fileSidebarGroupingLogic.ts @@ -70,7 +70,7 @@ export function buildLabelGroups( // Other = files in no visible group: unlabelled, or labelled only under hidden categories. const covered = new Set(); for (const group of visible) { - for (const stub of group.stubs) covered.add(stub.id as string); + for (const stub of group.stubs) covered.add(stub.id); } const other = stubs.filter((stub) => !covered.has(stub.id as string)); diff --git a/frontend/editor/src/proprietary/hooks/useFolderRunStatuses.ts b/frontend/editor/src/proprietary/hooks/useFolderRunStatuses.ts index 031d514f5f..78f00b1fab 100644 --- a/frontend/editor/src/proprietary/hooks/useFolderRunStatuses.ts +++ b/frontend/editor/src/proprietary/hooks/useFolderRunStatuses.ts @@ -51,7 +51,7 @@ export function useFolderRunStatuses( ); return [folder.id, deriveStatus(runs)] as const; } catch { - return [folder.id, "idle" as FolderRunStatus] as const; + return [folder.id, "idle"] as const; } }), ); diff --git a/frontend/editor/src/proprietary/policies/codec.ts b/frontend/editor/src/proprietary/policies/codec.ts index 2ef68514e4..e6fbdf739d 100644 --- a/frontend/editor/src/proprietary/policies/codec.ts +++ b/frontend/editor/src/proprietary/policies/codec.ts @@ -62,10 +62,8 @@ export function fromWirePolicy(policy: WirePolicy): PolicyDecodedState { name: policy.name, enabled: policy.enabled, categoryId, - sources: Array.isArray(raw.sources) ? (raw.sources as string[]) : [], - scopeTypes: Array.isArray(raw.scopeTypes) - ? (raw.scopeTypes as string[]) - : [], + sources: Array.isArray(raw.sources) ? raw.sources : [], + scopeTypes: Array.isArray(raw.scopeTypes) ? raw.scopeTypes : [], reviewerEmail: str(raw.reviewerEmail), fieldValues: raw.fieldValues ?? {}, runOn: resolveRunOn(raw.runOn, categoryId), diff --git a/frontend/editor/src/proprietary/routes/Login.test.tsx b/frontend/editor/src/proprietary/routes/Login.test.tsx index d2cb80360f..29ae9d9d79 100644 --- a/frontend/editor/src/proprietary/routes/Login.test.tsx +++ b/frontend/editor/src/proprietary/routes/Login.test.tsx @@ -10,7 +10,6 @@ import { PreferencesProvider } from "@app/contexts/PreferencesContext"; import { TestQueryProvider } from "@app/tests/utils/TestQueryProvider"; import apiClient from "@app/services/apiClient"; import { configureSpringAuth } from "@app/auth/config"; -import type { AxiosInstance } from "axios"; // Mock i18n to return fallback text vi.mock("react-i18next", () => ({ @@ -137,7 +136,7 @@ describe("Login", () => { // The shared login hook reads getSpringAuthConfig().http; in the real app, // startup points that at apiClient. Mirror that here so the mocked apiClient // serves the login-ui-data fetch. - configureSpringAuth({ http: apiClient as unknown as AxiosInstance }); + configureSpringAuth({ http: apiClient }); }); it("should render login form", async () => { diff --git a/frontend/editor/src/proprietary/services/heuristic/heuristicEngine.ts b/frontend/editor/src/proprietary/services/heuristic/heuristicEngine.ts index ed01b9542e..8d2f795636 100644 --- a/frontend/editor/src/proprietary/services/heuristic/heuristicEngine.ts +++ b/frontend/editor/src/proprietary/services/heuristic/heuristicEngine.ts @@ -387,8 +387,7 @@ export async function ensureRulesLoaded(): Promise { if (!loadPromise) { loadPromise = import("@app/services/heuristic/heuristicRules.json").then( (mod) => { - const root = ((mod as { default?: RulesFile }).default ?? - (mod as RulesFile)) as RulesFile; + const root = (mod as { default?: RulesFile }).default ?? mod; PREPARED = prepare(root.labels ?? []); PRIORS = loadPriors(root.priors ?? {}); }, diff --git a/frontend/editor/src/proprietary/services/heuristic/heuristicExtractor.ts b/frontend/editor/src/proprietary/services/heuristic/heuristicExtractor.ts index 426c1133e1..fb51b407b6 100644 --- a/frontend/editor/src/proprietary/services/heuristic/heuristicExtractor.ts +++ b/frontend/editor/src/proprietary/services/heuristic/heuristicExtractor.ts @@ -186,8 +186,7 @@ async function metadata( } catch { return {}; } - const get = (k: string) => - typeof info[k] === "string" ? (info[k] as string) : ""; + const get = (k: string) => (typeof info[k] === "string" ? info[k] : ""); return { title: get("Title"), author: get("Author"), diff --git a/frontend/editor/src/proprietary/services/policyExport.ts b/frontend/editor/src/proprietary/services/policyExport.ts index 78b747182b..91b68f8edd 100644 --- a/frontend/editor/src/proprietary/services/policyExport.ts +++ b/frontend/editor/src/proprietary/services/policyExport.ts @@ -222,7 +222,7 @@ export async function enforceExportPolicies( fileId, fileName: file.name, fileSize: file.size, - target: versionRun!.target, + target: versionRun.target, status: "COMPLETED", outputs: versionRun.outputs, error: null, diff --git a/frontend/editor/src/saas/auth/UseSession.test.ts b/frontend/editor/src/saas/auth/UseSession.test.ts index d5f8124948..94e1ffcb6a 100644 --- a/frontend/editor/src/saas/auth/UseSession.test.ts +++ b/frontend/editor/src/saas/auth/UseSession.test.ts @@ -17,7 +17,7 @@ function makeUser(overrides: Partial = {}): User { user_metadata: {}, created_at: "2026-01-01T00:00:00Z", ...overrides, - } as User; + }; } describe("saas deriveDisplayName", () => { diff --git a/frontend/editor/src/saas/components/SignupRequiredBootstrap.tsx b/frontend/editor/src/saas/components/SignupRequiredBootstrap.tsx index b9028ce22b..7ba4230ef5 100644 --- a/frontend/editor/src/saas/components/SignupRequiredBootstrap.tsx +++ b/frontend/editor/src/saas/components/SignupRequiredBootstrap.tsx @@ -46,12 +46,8 @@ export default function SignupRequiredBootstrap() { return true; }); }; - window.addEventListener("payg:signupRequired", handler as EventListener); - return () => - window.removeEventListener( - "payg:signupRequired", - handler as EventListener, - ); + window.addEventListener("payg:signupRequired", handler); + return () => window.removeEventListener("payg:signupRequired", handler); }, []); // Map the server's gate categories to user-facing nouns. The server diff --git a/frontend/editor/src/saas/components/shared/AppConfigModal.tsx b/frontend/editor/src/saas/components/shared/AppConfigModal.tsx index ab93f734fb..11b8957deb 100644 --- a/frontend/editor/src/saas/components/shared/AppConfigModal.tsx +++ b/frontend/editor/src/saas/components/shared/AppConfigModal.tsx @@ -80,12 +80,8 @@ const AppConfigModal: React.FC = ({ setMobilePane("content"); } }; - window.addEventListener("appConfig:navigate", handler as EventListener); - return () => - window.removeEventListener( - "appConfig:navigate", - handler as EventListener, - ); + window.addEventListener("appConfig:navigate", handler); + return () => window.removeEventListener("appConfig:navigate", handler); }, []); // When the modal opens via a /settings/
deep link (navigateToSettings — e.g. the @@ -122,9 +118,8 @@ const AppConfigModal: React.FC = ({ setNotice(detail.notice); } }; - window.addEventListener("appConfig:notice", handler as EventListener); - return () => - window.removeEventListener("appConfig:notice", handler as EventListener); + window.addEventListener("appConfig:notice", handler); + return () => window.removeEventListener("appConfig:notice", handler); }, []); // Full-screen overlays that live inside our React tree (e.g. the PAYG @@ -140,9 +135,8 @@ const AppConfigModal: React.FC = ({ | undefined; setOverlayActive(Boolean(detail?.open)); }; - window.addEventListener("appConfig:overlay", handler as EventListener); - return () => - window.removeEventListener("appConfig:overlay", handler as EventListener); + window.addEventListener("appConfig:overlay", handler); + return () => window.removeEventListener("appConfig:overlay", handler); }, []); const colors = useMemo( diff --git a/frontend/editor/src/saas/components/shared/charts/StackedBarChart.tsx b/frontend/editor/src/saas/components/shared/charts/StackedBarChart.tsx index 5f56843dae..0224b0837b 100644 --- a/frontend/editor/src/saas/components/shared/charts/StackedBarChart.tsx +++ b/frontend/editor/src/saas/components/shared/charts/StackedBarChart.tsx @@ -211,11 +211,9 @@ export default function StackedBarChart({ setTooltipContent(html); const tooltip = tooltipRef.current; if (tooltip) tooltip.style.opacity = "1"; - positionTooltip(event as unknown as MouseEvent); + positionTooltip(event); }) - .on("mousemove", (event: MouseEvent) => - positionTooltip(event as unknown as MouseEvent), - ) + .on("mousemove", (event: MouseEvent) => positionTooltip(event)) .on("mouseleave", hideTooltip); // Animate reveal of used segments (only on first load, not on re-renders) diff --git a/frontend/editor/src/saas/components/shared/config/configSections/Overview.tsx b/frontend/editor/src/saas/components/shared/config/configSections/Overview.tsx index 3a28152425..62f84977c1 100644 --- a/frontend/editor/src/saas/components/shared/config/configSections/Overview.tsx +++ b/frontend/editor/src/saas/components/shared/config/configSections/Overview.tsx @@ -562,15 +562,7 @@ const Overview: React.FC = ({ onLogoutClick }) => { style={{ width: 16, height: 16 }} /> } - onClick={() => - handleOAuthUpgrade( - provider.id as - | "github" - | "google" - | "apple" - | "azure", - ) - } + onClick={() => handleOAuthUpgrade(provider.id)} disabled={isLoading} > {provider.label} diff --git a/frontend/editor/src/saas/components/tools/sign/SignSettings.tsx b/frontend/editor/src/saas/components/tools/sign/SignSettings.tsx index 503087cbe4..59920ab6fb 100644 --- a/frontend/editor/src/saas/components/tools/sign/SignSettings.tsx +++ b/frontend/editor/src/saas/components/tools/sign/SignSettings.tsx @@ -547,7 +547,7 @@ const SignSettings = ({ return; } const nextSource = allowedSignatureSources.includes( - parameters.signatureType as SignatureSource, + parameters.signatureType, ) ? (parameters.signatureType as SignatureSource) : effectiveDefaultSource; @@ -1314,9 +1314,7 @@ const SignSettings = ({ - handleSignatureSourceChange(value as SignatureSource) - } + onChange={(value) => handleSignatureSourceChange(value)} options={sourceOptions} /> )} diff --git a/frontend/editor/src/saas/routes/OAuthConsent.tsx b/frontend/editor/src/saas/routes/OAuthConsent.tsx index f22f13fa19..f2acc03899 100644 --- a/frontend/editor/src/saas/routes/OAuthConsent.tsx +++ b/frontend/editor/src/saas/routes/OAuthConsent.tsx @@ -35,9 +35,8 @@ interface AuthorizationDetails { }; } -const SUPABASE_URL = import.meta.env.VITE_SUPABASE_URL as string; -const SUPABASE_KEY = import.meta.env - .VITE_SUPABASE_PUBLISHABLE_DEFAULT_KEY as string; +const SUPABASE_URL = import.meta.env.VITE_SUPABASE_URL; +const SUPABASE_KEY = import.meta.env.VITE_SUPABASE_PUBLISHABLE_DEFAULT_KEY; async function gotrue( path: string, diff --git a/frontend/editor/src/saas/setupTests.ts b/frontend/editor/src/saas/setupTests.ts index 3e8864e49e..6b04e18efd 100644 --- a/frontend/editor/src/saas/setupTests.ts +++ b/frontend/editor/src/saas/setupTests.ts @@ -130,7 +130,7 @@ Object.defineProperty(globalThis, "crypto", { } return array; }), - } as unknown as Crypto, + }, writable: true, configurable: true, });