docs: explain 29 scoped lint exceptions for HEL-762 batch 4

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
leefer
2026-10-22 04:14:43 +08:00
co-authored by multica-agent
parent 46fd5bbc86
commit 4c849e9ef9
19 changed files with 96 additions and 0 deletions
@@ -61,6 +61,7 @@
/** Later tool results (wait_for_jobs) often have the finished status + paths. */
const trailJobsById = $derived.by(() => {
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Each derivation rebuilds this tool-result lookup from messages; only the completed Map escapes, with no later mutation.
const map = new Map<number, ArtifactJob>();
for (const row of messages) {
if (row.role !== 'tool' || !row.tool_result || typeof row.tool_result !== 'object') continue;
@@ -76,6 +76,7 @@ let {
void draftNonce;
if (draftNonce === 0) return;
if (!editorEl) return;
// eslint-disable-next-line svelte/no-dom-manipulating -- Template owns the empty editor shell; its user-editable subtree is imperative. Restore draft text before caret placement/focus and serialization.
editorEl.textContent = draft;
placeCaretAtEnd(editorEl);
editorEl.focus();
@@ -161,6 +162,7 @@ let {
attachments: [...attachments],
};
if (payloadIsEmpty(payload)) return;
// eslint-disable-next-line svelte/no-dom-manipulating -- Template does not render editor children; after serializing text/chips, clear the user-owned subtree before onSend, preserving submit/reset behavior.
if (editorEl) editorEl.innerHTML = '';
attachments = [];
mentionOpen = false;
@@ -291,8 +293,10 @@ let {
chip.after(space);
placeCaretAfter(space);
} else {
// eslint-disable-next-line svelte/no-dom-manipulating -- Editor owns its children: fallback appends a noneditable workflow chip whose dataset serialize reads; keep template shell and caret logic intact.
editorEl.appendChild(makeChip(wf));
const space = document.createTextNode('\u00a0');
// eslint-disable-next-line svelte/no-dom-manipulating -- Editor-owned trailing space provides a text caret after the workflow chip; placeCaretAfter uses this exact node.
editorEl.appendChild(space);
placeCaretAfter(space);
}
@@ -327,8 +331,10 @@ let {
chip.after(space);
placeCaretAfter(space);
} else {
// eslint-disable-next-line svelte/no-dom-manipulating -- Editor owns its children: fallback appends a noneditable skill chip whose dataset serialize reads; keep template shell and caret logic intact.
editorEl.appendChild(makeSkillChip(skill));
const space = document.createTextNode('\u00a0');
// eslint-disable-next-line svelte/no-dom-manipulating -- Editor-owned trailing space provides a text caret after the skill chip; placeCaretAfter uses this exact node.
editorEl.appendChild(space);
placeCaretAfter(space);
}
@@ -28,6 +28,7 @@
const sandbox = $derived(sessions.filter((s) => s.project_id == null));
const grouped = $derived.by(() => {
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Local grouping accumulator is consumed as an array in this derivation; sessions drive recomputation, not Map writes.
const map = new Map<number, { project: AgentSession['project']; items: AgentSession[] }>();
for (const s of sessions) {
if (s.project_id == null) continue;
@@ -55,6 +55,7 @@
if (!open || !menuEl) return;
document.body.appendChild(menuEl);
return () => {
// eslint-disable-next-line svelte/no-dom-manipulating -- Template creates menu contents; this effect moves the root to body and owns portal teardown on close/unmount. Remove that moved root to avoid residue.
menuEl?.remove();
};
});
@@ -136,6 +136,7 @@
// Full records, lazily fetched per id (selected workflow, feed jobs'
// workflows, the bay's preview row) and cached until invalidated.
const details = new SvelteMap<number, Workflow>();
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Nonreactive request gate: ensureDetail reads has synchronously in the effect; reactive delete on failure would re-arm requests without a cached detail.
const inflight = new Set<number>();
async function ensureDetail(id: number): Promise<Workflow | null> {
@@ -155,6 +156,7 @@
}
const neededIds = $derived.by(() => {
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Rebuilt from workflowId, bay selection and jobs on each derivation; this completed ID set is never mutated by consumers.
const ids = new Set<number>();
if (workflowId != null) ids.add(workflowId);
if (bayOpen && bayActiveId != null) ids.add(bayActiveId);
@@ -19,6 +19,7 @@
let { kind, metas, active, onSelect, onPickWorkflow }: Props = $props();
const modes = $derived.by(() => {
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Local counting accumulator is consumed synchronously into mode rows; metas/kind drive the derivation.
const counts = new Map<WorkflowUsage, number>();
for (const m of metas) {
if (!m.usage) continue;
@@ -116,7 +116,9 @@
/** Composer-wide drop: each file goes to the first wired slot of its kind with room. */
export function dropFiles(files: File[]) {
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Per-drop allocation buffer, synchronously consumed into groupAdd calls; no collection state survives this invocation.
const pending = new Map<string, File[]>();
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Per-drop reservation set prevents assigning two files to one slot before async upload completes; never used as render state.
const taken = new Set<string>();
let unplaced = 0;
for (const f of files) {
@@ -125,6 +125,7 @@
// Entrance bookkeeping: only takes that appear AFTER the first fill
// (or come back from an undo) play the 220ms rise.
// ------------------------------------------------------------------
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Nonreactive entrance ledger read/written in the jobs effect and markEnter; keep bookkeeping outside effect dependencies, with animateIds driving classes.
const seenIds = new Set<number>();
const animateIds = new SvelteSet<number>();
let hydrated = false;
@@ -78,6 +78,7 @@
// The same path can arrive twice (e.g. a scene clip that was also
// uploaded to the playground). Duplicate keys crash the keyed each
// in the picker grid, so dedupe by path first.
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Local path deduplication scratch set for one filter pass; only the filtered asset array escapes.
const seen = new Set<string>();
return assetOptions.filter((o) => {
const match =
@@ -63,6 +63,7 @@
if (!open || !panelEl) return;
document.body.appendChild(panelEl);
return () => {
// eslint-disable-next-line svelte/no-dom-manipulating -- Template creates panel contents; effect owns body portal placement and teardown. Remove the moved root on close/unmount; listener cleanup stays separate.
panelEl?.remove();
};
});
@@ -85,6 +85,7 @@
if (!open || !menuEl) return;
document.body.appendChild(menuEl);
return () => {
// eslint-disable-next-line svelte/no-dom-manipulating -- Template creates menu contents; effect owns body portal placement and teardown. Remove the moved root on close/unmount; selection and listener cleanup stay intact.
menuEl?.remove();
};
});
@@ -198,6 +198,7 @@
function toggleIssue(f: WorkflowConvertFileReport) {
const key = rk(f);
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Mutate an isolated copy then assign expandedIssues once; rendering observes the state replacement, not intermediate Set writes.
const next = new Set(expandedIssues);
if (next.has(key)) next.delete(key);
else next.add(key);
@@ -235,6 +235,7 @@
);
function toggleRow(id: number, on: boolean) {
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Keep copy/mutate/assign selection semantics: row toggle publishes selected only after the working copy is complete.
const next = new Set(selected);
if (on) next.add(id);
else next.delete(id);
@@ -242,6 +243,7 @@
}
function toggleSelectVisible() {
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Keep copy/mutate/assign selection semantics: visible rows are added/removed before publishing selected once.
const next = new Set(selected);
if (allVisibleSelected) {
for (const r of visible) next.delete(r.id);
@@ -319,6 +321,7 @@
mutationFn: (id: number) => workflows.delete(id),
onSuccess: (_res, id) => {
invalidateWorkflows();
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Delete success removes the ID from a working copy, then replaces selected; preserve the existing publication boundary.
const next = new Set(selected);
next.delete(id);
selected = next;
@@ -69,6 +69,7 @@ let gizmoDragging = false;
ready: boolean;
type: SceneObject['type'];
}
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Imperative RAF scene registry; keep collection writes out of pose/tool dependencies. Scene state and figureRevision explicitly trigger solves; SvelteMap would track collection reads.
const instances = new Map<string, Instance>();
// capture-request guard: SSE may ask while a previous capture renders
@@ -494,6 +495,7 @@ let exporting = false;
renderer = new THREE.WebGLRenderer({ antialias: true, preserveDrawingBuffer: true });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.shadowMap.enabled = true;
// eslint-disable-next-line svelte/no-dom-manipulating -- Template owns the container/toolbar; Three owns this canvas. Mount renderer output here; destroy cancels RAF, disconnects resize and disposes controls/renderer.
container.appendChild(renderer.domElement);
scene = new THREE.Scene();
+1
View File
@@ -240,6 +240,7 @@
);
const projectTitles = $derived.by(() => {
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Project-title lookup is rebuilt from allProjects each derivation; consumers only read the completed Map.
const map = new Map<number, string>();
for (const p of allProjects) map.set(p.id, p.title);
return map;
@@ -181,6 +181,7 @@
const scenes = $scenesQuery.data?.scenes ?? [];
const jobs = $jobsQuery.data ?? [];
// An artifact node is "running" while its tracked job is queued/running.
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Effect-local job lookup is built and synchronously consumed into nodes, then discarded; graph/jobs already drive the effect.
const nodeRunning = new Map<number, boolean>();
for (const n of graph.nodes) {
const tracked = n.job_id != null ? jobs.find((j) => j.id === n.job_id) : undefined;
@@ -87,6 +87,7 @@
);
function toggle(path: string) {
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- Selection toggles mutate a copy then replace selected; preserve one state publication after the toggle.
const next = new Set(selected);
if (next.has(path)) next.delete(path);
else next.add(path);
@@ -77,6 +77,7 @@
if (MOVED_TABS[raw]) {
const destination = new SvelteURL(nav.to!.url);
destination.pathname = MOVED_TABS[raw];
// eslint-disable-next-line svelte/no-navigation-without-resolve -- Runtime target derives from afterNavigate URL and MOVED_TABS; preserve query/hash and replaceState on this legacy redirect rather than re-resolving the full target.
goto(destination.pathname + destination.search + destination.hash, {
replaceState: true,
});
@@ -232,6 +233,7 @@
const url = pendingUrl;
pendingUrl = null;
discardDraft();
// eslint-disable-next-line svelte/no-navigation-without-resolve -- Resume the pathname/query/hash captured by beforeNavigate after discard confirmation; cancellation retains the draft. Preserve this runtime target and goto options.
if (url) goto(url);
}