chore(frontend): add eslint quality gate
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useMemo, useState } from "react";
|
||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||
|
||||
import {
|
||||
Alert,
|
||||
@@ -222,7 +222,7 @@ export default function AdminSystemPage() {
|
||||
const [testEmailMessage, setTestEmailMessage] = useState(() => t("adminSystemDefaultTestMessage"));
|
||||
const [sendingTestEmail, setSendingTestEmail] = useState(false);
|
||||
|
||||
const load = async () => {
|
||||
const load = useCallback(async () => {
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
try {
|
||||
@@ -244,11 +244,11 @@ export default function AdminSystemPage() {
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
}, [t]);
|
||||
|
||||
useEffect(() => {
|
||||
void load();
|
||||
}, []);
|
||||
}, [load]);
|
||||
|
||||
const dbTone = useMemo(() => {
|
||||
if (!status) return "default" as const;
|
||||
@@ -290,7 +290,7 @@ export default function AdminSystemPage() {
|
||||
}
|
||||
return findings;
|
||||
}).slice(0, 10);
|
||||
}, [benchmarkIndex, language]);
|
||||
}, [benchmarkIndex, t]);
|
||||
|
||||
const sendTestEmail = async () => {
|
||||
setSendingTestEmail(true);
|
||||
|
||||
@@ -7,11 +7,6 @@ import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
||||
import PhotoCameraOutlinedIcon from "@mui/icons-material/PhotoCameraOutlined";
|
||||
|
||||
import { api, getApiErrorMessage } from "../api";
|
||||
import GoogleAuthCard from "../components/GoogleAuthCard";
|
||||
import MicrosoftAuthCard from "../components/MicrosoftAuthCard";
|
||||
import AuthStatusCard from "../components/AuthStatusCard";
|
||||
import TwoFactorSettingsCard from "../components/TwoFactorSettingsCard";
|
||||
import SessionsSettingsCard from "../components/SessionsSettingsCard";
|
||||
import CropImageDialog from "../components/CropImageDialog";
|
||||
import ProfileCompleteness from "./career/ProfileCompleteness";
|
||||
import CareerWorkspaceOverview from "./career/CareerWorkspaceOverview";
|
||||
@@ -34,11 +29,7 @@ import type { UserOperation } from "../types";
|
||||
import {
|
||||
emptyStructuredCv,
|
||||
getStructuredCvFieldMetadata,
|
||||
joinLines,
|
||||
normalizeStructuredCv,
|
||||
parseStructuredCvJson,
|
||||
splitLines,
|
||||
StructuredCvFieldMetadata,
|
||||
StructuredCvProfile,
|
||||
} from "../profileCv";
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ export default function CorrespondenceInboxPage() {
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, [direction, inboxPage, language, linkState, query, toast]);
|
||||
}, [direction, inboxPage, linkState, query, t, toast]);
|
||||
|
||||
useEffect(() => {
|
||||
if (view === "inbox") void load();
|
||||
@@ -215,7 +215,7 @@ export default function CorrespondenceInboxPage() {
|
||||
} catch {
|
||||
setDraftError(t("emailInboxDraftsLoadFailed"));
|
||||
}
|
||||
}, [language]);
|
||||
}, [t]);
|
||||
|
||||
useEffect(() => {
|
||||
void loadStoredDrafts();
|
||||
|
||||
@@ -1060,7 +1060,7 @@ function EntryEditor({ section, row, settings, onPatch, onUpdateSettings }: {
|
||||
const m: Record<string, (typeof section.entries)[number]> = {};
|
||||
section.entries.forEach((e) => { if (e.key) m[e.key] = e; });
|
||||
return m;
|
||||
}, [section.entries]);
|
||||
}, [section]);
|
||||
|
||||
const drag = useDragReorder((from, to) => onPatch({ itemOrder: moveItem(orderedKeys, from, to) }));
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
import {
|
||||
@@ -31,7 +31,7 @@ export default function CvBuilderPage() {
|
||||
const [newTheme, setNewTheme] = useState("modern");
|
||||
const [creating, setCreating] = useState(false);
|
||||
|
||||
const load = async () => {
|
||||
const load = useCallback(async () => {
|
||||
try {
|
||||
setVariants(await cvBuilderApi.list());
|
||||
try { setThemes(await cvBuilderApi.themes()); } catch { setThemes([]); }
|
||||
@@ -40,10 +40,10 @@ export default function CvBuilderPage() {
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
}, [t]);
|
||||
useEffect(() => {
|
||||
load();
|
||||
}, []);
|
||||
void load();
|
||||
}, [load]);
|
||||
|
||||
const createNew = async () => {
|
||||
setCreateOpen(true);
|
||||
|
||||
@@ -55,7 +55,7 @@ export default function OperationsPage() {
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, [language]);
|
||||
}, [t]);
|
||||
|
||||
useEffect(() => {
|
||||
void load();
|
||||
|
||||
@@ -98,7 +98,7 @@ export default function CareerWorkspaceOverview({ completeness, runs, loading, l
|
||||
if (active.length > 0) return { severity: "info" as const, label: t("careerOverviewViewProcessing"), message: t(active.length === 1 ? "careerOverviewProcessingOne" : "careerOverviewProcessingMany", { count: active.length }) };
|
||||
if (failed.length > 0) return { severity: "error" as const, label: t("careerOverviewResolveImport"), message: t(failed.length === 1 ? "careerOverviewFailedOne" : "careerOverviewFailedMany", { count: failed.length }) };
|
||||
return { severity: "success" as const, label: t("careerOverviewImportCv"), message: t(runs.length > 0 ? "careerOverviewImportComplete" : "careerOverviewNoImport") };
|
||||
}, [language, runs, t]);
|
||||
}, [runs, t]);
|
||||
|
||||
const isFirstRun = !loading && !recentLoading && !loadError && (completeness?.percent ?? 0) === 0 && runs.length === 0 && recentCvs.length === 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user