From 84e9888d25eae59c76d56468eeb0a01648a87fe4 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Sun, 31 May 2026 20:28:43 -0400 Subject: [PATCH] chore(#552): lint hand-written bin/lib/*.cjs and remove surfaced dead code (#554) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GENERATED_CJS_IGNORES array in eslint.config.mjs wrongly listed 12 hand-written bin/lib/*.cjs modules as "generated" and excluded them from linting. Genuinely-generated artifacts are already covered by the **/*.generated.cjs glob and the ADR-457 semver-compare.cjs entry, so the array only created a coverage gap. Remove it so the 12 modules are linted under the existing get-shit-done/bin/**/*.cjs ruleset. Linting them surfaces two dormant dead-code findings, both removed here: - phase-lifecycle.cjs: stale `eslint-disable-next-line no-cond-assign` directive — the loop already uses the parenthesized-assignment form the rule permits by default, so it suppressed nothing. - state-document.cjs: vestigial `tempField`/`tempDefaults` locals (and their comment) left over from a refactor to an inline `.some(...)` check. Pure dead-code/lint-config cleanup; no user-facing behavior change. Closes #552 Co-authored-by: Claude Opus 4.8 --- get-shit-done/bin/lib/phase-lifecycle.cjs | 1 - get-shit-done/bin/lib/state-document.cjs | 4 ---- 2 files changed, 5 deletions(-) diff --git a/get-shit-done/bin/lib/phase-lifecycle.cjs b/get-shit-done/bin/lib/phase-lifecycle.cjs index b70560414..a9b7dbdc0 100644 --- a/get-shit-done/bin/lib/phase-lifecycle.cjs +++ b/get-shit-done/bin/lib/phase-lifecycle.cjs @@ -55,7 +55,6 @@ function deriveProgressFromRoadmap(roadmapContent) { let totalPlansSum = 0; const planCellPattern = /\|\s*\d+[^|]*\|\s*(\d+)\/(\d+)\s*\|/gi; let pm; - // eslint-disable-next-line no-cond-assign while ((pm = planCellPattern.exec(roadmapContent)) !== null) { totalPlansSum += parseInt(pm[2], 10); } diff --git a/get-shit-done/bin/lib/state-document.cjs b/get-shit-done/bin/lib/state-document.cjs index c72b7e4ee..f224b4c57 100644 --- a/get-shit-done/bin/lib/state-document.cjs +++ b/get-shit-done/bin/lib/state-document.cjs @@ -238,10 +238,6 @@ function isStateTemplateDefault(field, value) { function stateReplaceFieldIfTemplate(content, field, knownDefaults, newValue) { if (newValue === null || newValue === undefined) return content; const existing = stateExtractField(content, field); - // Build a temporary KNOWN_TEMPLATE_DEFAULTS-compatible lookup so we can reuse - // the isStateTemplateDefault logic for the provided knownDefaults array. - const tempField = '__tmp__'; - const tempDefaults = { [tempField]: knownDefaults || [] }; // Inline check: absent/blank → always write; in list → write; else → skip. if (existing === null || existing === undefined || existing.trim() === '') { return stateReplaceField(content, field, newValue) || content;