chore: finish frontend ESLint migration #18

Enable every plugin recommended preset and replace Biome with ESLint formatting.

Preserve API contracts and JSX whitespace; verify source, tests, builds and tooling.
This commit is contained in:
2026-09-28 16:36:40 +03:00
committed by ksv741
parent 57630102e4
commit 72d7835227
253 changed files with 10059 additions and 8864 deletions
@@ -1,7 +1,9 @@
import type { FC } from "react";
import { Stack } from "@mantine/core";
import { StateView } from "@wealthledger/ui";
import type { FC } from "react";
import { useTranslation } from "react-i18next";
import {
AccountsRefreshState,
type AccountsRefreshStateProps,
@@ -13,8 +15,8 @@ const AccountsPageEmpty: FC<AccountsRefreshStateProps> = (props) => {
<Stack>
<AccountsRefreshState {...props} />
<StateView
title={t("accounts.emptyTitle")}
text={t("accounts.emptyText")}
title={t("accounts.emptyTitle")}
/>
</Stack>
);
@@ -1,6 +1,7 @@
import type { FC } from "react";
import { Button, Stack } from "@mantine/core";
import { StateView } from "@wealthledger/ui";
import type { FC } from "react";
import { useTranslation } from "react-i18next";
import { Link } from "react-router";
@@ -17,41 +18,41 @@ const AccountsPageError: FC<AccountsPageErrorProps> = (props) => {
if (code === "TBANK_NOT_CONNECTED")
return (
<StateView
error
title={t("accounts.notConnectedTitle")}
text={t("accounts.notConnectedText")}
action={settingsAction}
error
text={t("accounts.notConnectedText")}
title={t("accounts.notConnectedTitle")}
/>
);
if (code === "INVALID_TBANK_TOKEN")
return (
<StateView
error
title={t("accounts.invalidTokenTitle")}
text={t("accounts.invalidTokenText")}
action={settingsAction}
error
text={t("accounts.invalidTokenText")}
title={t("accounts.invalidTokenTitle")}
/>
);
if (code === "TBANK_UNAVAILABLE")
return (
<StateView
error
title={t("accounts.unavailableTitle")}
text={t("accounts.unavailableText")}
action={
action={(
<Stack align="flex-start">
<Button onClick={retry}>{t("accounts.retry")}</Button>
{settingsAction}
</Stack>
}
)}
error
text={t("accounts.unavailableText")}
title={t("accounts.unavailableTitle")}
/>
);
return (
<StateView
error
title={t("states.errorTitle")}
text={t("states.errorText")}
action={<Button onClick={retry}>{t("accounts.retry")}</Button>}
error
text={t("states.errorText")}
title={t("states.errorTitle")}
/>
);
};
@@ -1,11 +1,14 @@
import { Button, Stack, Text, Title } from "@mantine/core";
import type { FC } from "react";
import { Button, Stack, Text, Title } from "@mantine/core";
import { useTranslation } from "react-i18next";
import { Link } from "react-router";
import {
type BrokerageAccountCard,
BrokerageAccountList,
} from "@/entities/brokerage-account";
import {
AccountsRefreshState,
type AccountsRefreshStateProps,
@@ -1,6 +1,7 @@
import type { FC } from "react";
import { Card, Group, SimpleGrid, Skeleton, Stack } from "@mantine/core";
import { LoadingSkeleton } from "@wealthledger/ui";
import type { FC } from "react";
import { useTranslation } from "react-i18next";
const AccountsPageLoading: FC = () => {
@@ -9,8 +10,8 @@ const AccountsPageLoading: FC = () => {
<LoadingSkeleton label={t("states.loadingTitle")}>
<Skeleton height={32} width="30%" />
<Skeleton height={20} width="45%" />
<SimpleGrid cols={1} spacing="lg" aria-hidden="true">
{[0, 1].map((index) => (
<SimpleGrid aria-hidden="true" cols={1} spacing="lg">
{[0, 1].map(index => (
<Card key={index} padding="xl" radius="lg" withBorder>
<Stack gap="xl">
<Stack gap="sm">
@@ -1,47 +1,49 @@
import { Alert, Button, Group, Loader, Stack, Text } from "@mantine/core";
import type { FC } from "react";
import { Alert, Button, Group, Loader, Stack, Text } from "@mantine/core";
import { useTranslation } from "react-i18next";
import { formatSnapshotTime } from "@/shared/lib";
type AccountsRefreshStateProps = {
lastSuccessfulAt?: string | null;
sourceError?: boolean;
refreshing?: boolean;
lastSuccessfulAt?: null | string;
refreshError?: boolean;
refreshing?: boolean;
retry?: () => void;
sourceError?: boolean;
};
const AccountsRefreshState: FC<AccountsRefreshStateProps> = (props) => {
const { refreshing = false, refreshError = false, retry } = props;
const { refreshError = false, refreshing = false, retry } = props;
const { t } = useTranslation();
return (
<>
{props.lastSuccessfulAt ? (
<Text size="xs" c="dimmed">
{!!(props.lastSuccessfulAt) && ((
<Text c="dimmed" size="xs">
{t("investment.sourceTime", {
date: formatSnapshotTime(props.lastSuccessfulAt),
})}
</Text>
) : null}
))}
<Button
onClick={retry}
disabled={refreshing}
onClick={retry}
variant="light"
w="fit-content"
>
{t(refreshError ? "accounts.retry" : "investment.refresh")}
</Button>
{refreshing ? (
<Group gap="xs" role="status" aria-label={t("accounts.refreshing")}>
{!!(refreshing) && ((
<Group aria-label={t("accounts.refreshing")} gap="xs" role="status">
<Loader size="sm" />
<Text c="dimmed" size="sm">
{t("accounts.refreshing")}
</Text>
</Group>
) : null}
{refreshError ? (
<Alert color="orange" role="status" aria-live="polite">
))}
{!!(refreshError) && ((
<Alert aria-live="polite" color="orange" role="status">
<Stack gap="sm">
<Text>
{t(
@@ -52,7 +54,7 @@ const AccountsRefreshState: FC<AccountsRefreshStateProps> = (props) => {
</Text>
</Stack>
</Alert>
) : null}
))}
</>
);
};