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
@@ -2,6 +2,7 @@ import { MantineProvider } from "@mantine/core";
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
import { MemoryRouter } from "react-router";
import { describe, expect, it, vi } from "vitest";
import { AuthForm } from "./AuthForm";
describe("AuthForm", () => {
@@ -10,7 +11,7 @@ describe("AuthForm", () => {
render(
<MantineProvider>
<MemoryRouter>
<AuthForm register onSubmit={onSubmit} />
<AuthForm onSubmit={onSubmit} register />
</MemoryRouter>
</MantineProvider>,
);
+9 -6
View File
@@ -1,10 +1,12 @@
import type { FC } from "react";
import { zodResolver } from "@hookform/resolvers/zod";
import { Alert, Button, PasswordInput, Stack, TextInput } from "@mantine/core";
import type { FC } from "react";
import { useState } from "react";
import { FormProvider, type Resolver, useForm } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { Link } from "react-router";
import {
type AuthFormValues,
loginSchema,
@@ -13,12 +15,12 @@ import {
import classes from "./AuthForm.module.css";
type AuthFormProps = {
register?: true;
onSubmit: (email: string, password: string) => Promise<void>;
register?: true;
};
const AuthForm: FC<AuthFormProps> = (props) => {
const { register, onSubmit } = props;
const { onSubmit, register } = props;
const { t } = useTranslation();
const schema = register ? registerSchema : loginSchema;
const methods = useForm<AuthFormValues>({
@@ -27,7 +29,7 @@ const AuthForm: FC<AuthFormProps> = (props) => {
const {
formState: { errors, isSubmitting },
} = methods;
const [submitError, setSubmitError] = useState<string | null>(null);
const [submitError, setSubmitError] = useState<null | string>(null);
return (
<FormProvider {...methods}>
<form
@@ -35,7 +37,8 @@ const AuthForm: FC<AuthFormProps> = (props) => {
setSubmitError(null);
try {
await onSubmit(values.email, values.password);
} catch {
}
catch {
setSubmitError(t("auth.requestError"));
}
})}
@@ -60,7 +63,7 @@ const AuthForm: FC<AuthFormProps> = (props) => {
/>
)}
{submitError && <Alert color="red">{submitError}</Alert>}
<Button type="submit" loading={isSubmitting}>
<Button loading={isSubmitting} type="submit">
{t(register ? "auth.register" : "auth.login")}
</Button>
<Button