Add analyzer and frontend lint guardrails

This commit is contained in:
2026-02-07 02:12:00 +01:00
parent 34d274d244
commit 5b06e279f3
19 changed files with 1313 additions and 53 deletions

View File

@@ -7,7 +7,10 @@ function displayPlayerStatus(player) {
if (!player) return "";
const phase = player.phase;
if (phase === "Suggest") return t("admin.statusSuggesting");
if (phase === "Vote") return player.finalized ? t("admin.statusFinished") : t("admin.statusVoting");
if (phase === "Vote")
return player.finalized
? t("admin.statusFinished")
: t("admin.statusVoting");
if (phase === "Results") return t("admin.statusFinished");
return phase;
}
@@ -59,7 +62,9 @@ export function renderAdminLinker() {
const previousSource = source.value;
const previousTarget = target.value;
const options = (state.allSuggestions ?? []).slice().sort((a, b) => a.name.localeCompare(b.name));
const options = (state.allSuggestions ?? [])
.slice()
.sort((a, b) => a.name.localeCompare(b.name));
const fillSelect = (select, placeholderKey) => {
select.innerHTML = "";
@@ -81,8 +86,10 @@ export function renderAdminLinker() {
fillSelect(source, "admin.linkSourcePlaceholder");
fillSelect(target, "admin.linkTargetPlaceholder");
if (previousSource && options.some((s) => String(s.id) === previousSource)) source.value = previousSource;
if (previousTarget && options.some((s) => String(s.id) === previousTarget)) target.value = previousTarget;
if (previousSource && options.some((s) => String(s.id) === previousSource))
source.value = previousSource;
if (previousTarget && options.some((s) => String(s.id) === previousTarget))
target.value = previousTarget;
const preventSameSelection = () => {
const sourceVal = source.value;