fix sonar warnings

This commit is contained in:
Athou
2025-07-29 15:21:15 +02:00
parent 31e385fbfb
commit c3d4831550
69 changed files with 177 additions and 91 deletions

View File

@@ -32,7 +32,11 @@ const useStyles = tss.create(({ theme }) => ({
},
}))
export function ErrorPage(props: { error: Error }) {
export function ErrorPage(
props: Readonly<{
error: Error
}>
) {
const { classes } = useStyles()
return (

View File

@@ -12,7 +12,8 @@ import { Loader } from "@/components/Loader"
import { RelativeDate } from "@/components/RelativeDate"
function BooleanIcon({ value }: { value: boolean }) {
return value ? <TbCheck size={18} /> : <TbX size={18} />
const icon = value ? TbCheck : TbX
return icon({ size: 18 })
}
export function AdminUsersPage() {
@@ -56,7 +57,9 @@ export function AdminUsersPage() {
),
labels: { confirm: <Trans>Confirm</Trans>, cancel: <Trans>Cancel</Trans> },
confirmProps: { color: "red" },
onConfirm: async () => await deleteUser.execute({ id: user.id }),
onConfirm: () => {
deleteUser.execute({ id: user.id })
},
})
}

View File

@@ -20,7 +20,13 @@ const useStyles = tss.create(() => ({
},
}))
function Section(props: { title: React.ReactNode; icon: React.ReactNode; children: React.ReactNode }) {
function Section(
props: Readonly<{
title: React.ReactNode
icon: React.ReactNode
children: React.ReactNode
}>
) {
const { classes } = useStyles()
return (
<Box my="xl">

View File

@@ -66,7 +66,9 @@ export function CategoryDetailsPage() {
),
labels: { confirm: <Trans>Confirm</Trans>, cancel: <Trans>Cancel</Trans> },
confirmProps: { color: "red" },
onConfirm: async () => await deleteCategory.execute({ id: +id }),
onConfirm: () => {
deleteCategory.execute({ id: +id })
},
})
}

View File

@@ -41,7 +41,7 @@ function FilteringExpressionDescription() {
<a href="https://commons.apache.org/proper/commons-jexl/reference/syntax.html" target="_blank" rel="noreferrer">
here
</a>
.
<span>.</span>
</Trans>
</div>
</div>
@@ -86,7 +86,9 @@ export function FeedDetailsPage() {
),
labels: { confirm: <Trans>Confirm</Trans>, cancel: <Trans>Cancel</Trans> },
confirmProps: { color: "red" },
onConfirm: async () => await unsubscribe.execute({ id: +id }),
onConfirm: () => {
unsubscribe.execute({ id: +id })
},
})
}

View File

@@ -36,7 +36,7 @@ const useStyles = tss.create(() => ({
},
}))
export function FeedEntriesPage(props: FeedEntriesPageProps) {
export function FeedEntriesPage(props: Readonly<FeedEntriesPageProps>) {
const { classes } = useStyles()
const location = useLocation()
const { id = Constants.categories.all.id } = useParams()

View File

@@ -68,7 +68,7 @@ const useStyles = tss
}
})
export default function Layout(props: LayoutProps) {
export default function Layout(props: Readonly<LayoutProps>) {
const theme = useMantineTheme()
const mobile = useMobile()
const { isBrowserExtensionPopup } = useBrowserExtension()
@@ -206,7 +206,6 @@ export default function Layout(props: LayoutProps) {
grid={[30, 30]}
onDrag={(_e, data) => {
dispatch(setSidebarWidth(data.x))
return
}}
>
<Box