Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

fix(frontend): clear the small eslint rule violations

dextmorgn189048ea03ef
diff --git a/flowsint-app/src/api/api.ts b/flowsint-app/src/api/api.ts
index 129baf28..afa8bb63 100644
--- a/flowsint-app/src/api/api.ts
+++ b/flowsint-app/src/api/api.ts
@@ -22,22 +22,18 @@ export async function fetchWithAuth(endpoint: string, options: RequestInit = {})
}
}
- try {
- const response = await fetch(`${API_URL}${endpoint}`, config)
- if (response.status === 401) {
- useAuthStore.getState().logout()
- window.location.href = '/login'
- throw new Error('Session expired, login again.')
- }
- if (!response.ok) {
- const errorData = await response.json().catch(() => ({}))
- throw new Error(errorData.detail || `Erreur ${response.status}`)
- }
- if (response.status === 204) {
- return null
- }
- return await response.json()
- } catch (error) {
- throw error
+ const response = await fetch(`${API_URL}${endpoint}`, config)
+ if (response.status === 401) {
+ useAuthStore.getState().logout()
+ window.location.href = '/login'
+ throw new Error('Session expired, login again.')
+ }
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => ({}))
+ throw new Error(errorData.detail || `Erreur ${response.status}`)
+ }
+ if (response.status === 204) {
+ return null
}
+ return await response.json()
}
diff --git a/flowsint-app/src/components/analyses/analyses-list.tsx b/flowsint-app/src/components/analyses/analyses-list.tsx
index bf6b5f6b..7ac0f6e9 100644
--- a/flowsint-app/src/components/analyses/analyses-list.tsx
+++ b/flowsint-app/src/components/analyses/analyses-list.tsx
@@ -88,11 +88,12 @@ const AnalysisList = () => {
queryKey: queryKeys.analyses.byInvestigation(investigationId || '')
})
toast.success('Analysis created successfully')
- investigationId &&
+ if (investigationId) {
navigate({
to: '/dashboard/investigations/$investigationId/$type/$id',
params: { investigationId, type: 'analysis', id: data.id }
})
+ }
},
onError: (error) => {
toast.error(
diff --git a/flowsint-app/src/components/analyses/editor/components/spinner.tsx b/flowsint-app/src/components/analyses/editor/components/spinner.tsx
index fc8643cd..bef1ab00 100644
--- a/flowsint-app/src/components/analyses/editor/components/spinner.tsx
+++ b/flowsint-app/src/components/analyses/editor/components/spinner.tsx
@@ -1,7 +1,7 @@
import * as React from 'react'
import { cn } from '@/lib/utils'
-interface SpinnerProps extends React.SVGProps<SVGSVGElement> {}
+type SpinnerProps = React.SVGProps<SVGSVGElement>
const SpinnerComponent = React.forwardRef<SVGSVGElement, SpinnerProps>(function Spinner(
{ className, ...props },
diff --git a/flowsint-app/src/components/chat/memoized-markdown.tsx b/flowsint-app/src/components/chat/memoized-markdown.tsx
index 019fcf48..28982a3b 100644
--- a/flowsint-app/src/components/chat/memoized-markdown.tsx
+++ b/flowsint-app/src/components/chat/memoized-markdown.tsx
@@ -22,13 +22,14 @@ const MemoizedMarkdownBlock = memo(
return match ? (
<div className="relative">
<SyntaxHighlighter
- children={String(children).replace(/\n$/, '')}
style={dracula}
language={match[1]}
PreTag="div"
className="rounded border border-border bg-muted px-1 py-0.5 m-0! text-sm w-auto not-prose"
{...props}
- />
+ >
+ {String(children).replace(/\n$/, '')}
+ </SyntaxHighlighter>
<div className="absolute top-2 right-2">
<CopyButton content={String(children).replace(/\n$/, '')} />
</div>
diff --git a/flowsint-app/src/components/flows/flow-name-panel.tsx b/flowsint-app/src/components/flows/flow-name-panel.tsx
index 45ed5dba..e633692a 100644
--- a/flowsint-app/src/components/flows/flow-name-panel.tsx
+++ b/flowsint-app/src/components/flows/flow-name-panel.tsx
@@ -73,7 +73,8 @@ export const FlowNamePanel = ({ flow, onUpdate, disabled = false }: FlowNamePane
(field === 'name' && trimmedValue === flow.name) ||
(field === 'description' && trimmedValue === flow.description)
) {
- field === 'name' ? setIsEditingName(false) : setIsEditingDesc(false)
+ if (field === 'name') setIsEditingName(false)
+ else setIsEditingDesc(false)
return
}
@@ -93,7 +94,8 @@ export const FlowNamePanel = ({ flow, onUpdate, disabled = false }: FlowNamePane
}
} finally {
setIsSaving(false)
- field === 'name' ? setIsEditingName(false) : setIsEditingDesc(false)
+ if (field === 'name') setIsEditingName(false)
+ else setIsEditingDesc(false)
}
}
diff --git a/flowsint-app/src/components/layout/top-navbar.tsx b/flowsint-app/src/components/layout/top-navbar.tsx
index 99d93f39..fc897e60 100644
--- a/flowsint-app/src/components/layout/top-navbar.tsx
+++ b/flowsint-app/src/components/layout/top-navbar.tsx
@@ -127,13 +127,14 @@ export function InvestigationMenu({
const deleteSketchMutation = useMutation({
mutationFn: sketchService.delete,
onSuccess: () => {
- investigationId &&
+ if (investigationId) {
navigate({
to: '/dashboard/investigations/$investigationId',
params: {
investigationId: investigationId as string
}
})
+ }
},
onError: (error) => {
console.error('Error deleting sketch:', error)
diff --git a/flowsint-app/src/components/ui/input.tsx b/flowsint-app/src/components/ui/input.tsx
index 04900645..8eedb79f 100644
--- a/flowsint-app/src/components/ui/input.tsx
+++ b/flowsint-app/src/components/ui/input.tsx
@@ -2,7 +2,7 @@ import * as React from 'react'
import { cn } from '@/lib/utils'
-export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}
+export type InputProps = React.InputHTMLAttributes<HTMLInputElement>
const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, ...props }, ref) => {
diff --git a/flowsint-app/src/components/ui/resizable-container.tsx b/flowsint-app/src/components/ui/resizable-container.tsx
index 6fc8c5ef..4899908a 100644
--- a/flowsint-app/src/components/ui/resizable-container.tsx
+++ b/flowsint-app/src/components/ui/resizable-container.tsx
@@ -16,7 +16,9 @@ function loadPersistedSize(
return parsed
}
}
- } catch {}
+ } catch {
+ // invalid or missing stored value — fall back to defaults below
+ }
return { width: defaultWidth, height: defaultHeight }
}
diff --git a/flowsint-app/src/lib/utils.ts b/flowsint-app/src/lib/utils.ts
index 5f01711b..77ce1db5 100644
--- a/flowsint-app/src/lib/utils.ts
+++ b/flowsint-app/src/lib/utils.ts
@@ -319,7 +319,8 @@ export function deepObjectDiff(obj1: Dictionary, obj2: Dictionary): Dictionary {
// We map over the obj2 key:value duos to retrieve new keys that obj2 might have
Object.entries(obj2).forEach(([key, value]) => {
// We check for additional keys
- if (!obj1.hasOwnProperty(key)) diffObject = { ...diffObject, [key]: { value, new: true } }
+ if (!Object.prototype.hasOwnProperty.call(obj1, key))
+ diffObject = { ...diffObject, [key]: { value, new: true } }
else {
diffObject = {
...diffObject,
@@ -336,7 +337,8 @@ export function deepObjectDiff(obj1: Dictionary, obj2: Dictionary): Dictionary {
// We map over the obj1 key:value duos to retrieve keys that might have disapeared
Object.entries(obj1).forEach(([key, value]) => {
// We check for additional keys
- if (!obj2.hasOwnProperty(key)) diffObject = { ...diffObject, [key]: { value, removed: true } }
+ if (!Object.prototype.hasOwnProperty.call(obj2, key))
+ diffObject = { ...diffObject, [key]: { value, removed: true } }
})
return diffObject
}