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
+7 -6
View File
@@ -1,17 +1,18 @@
import type { Portfolio } from "../api/usePortfolio";
const PERCENT_SCALE = 100;
type Money = Portfolio["totalsByCurrency"][number];
function formatShare(
numerator: Money | null,
denominator: Money | null,
): string | null {
if (!numerator || !denominator) return null;
): null | string {
if (!numerator || !denominator) return /* eslint-disable-line unicorn/no-null -- The existing formatter contract uses null for unavailable data. */ null;
const total = Number(denominator.value);
if (!Number.isFinite(total) || total <= 0) return null;
// biome-ignore lint/style/noMagicNumbers: obvious conversion of a ratio to percent.
const percent = (Number(numerator.value) / total) * 100;
if (!Number.isFinite(percent)) return null;
if (!Number.isFinite(total) || total <= 0) return /* eslint-disable-line unicorn/no-null -- The existing formatter contract uses null for unavailable data. */ null;
const percent = (Number(numerator.value) / total) * PERCENT_SCALE;
if (!Number.isFinite(percent)) return /* eslint-disable-line unicorn/no-null -- The existing formatter contract uses null for unavailable data. */ null;
const rounded = new Intl.NumberFormat("ru-RU", {
maximumFractionDigits: 1,
}).format(percent);