chore: clean up clear-cut ESLint warnings (#732) (#734)

Pay down pre-existing error→warn lint debt. Removes dead imports/vars, unused functions, redundant regex/string escapes, and stale eslint-disable directives; converts unused `catch (_e)` to optional catch binding (src/*.cts).

No behavior change. Lint 345→125 warnings (0 errors); deferred categories (n/no-process-exit, test-sleeps, control-regex) tracked in #732 for follow-up. Full test suite green (0 failures); code-review verified all removals unused and all escape fixes semantics-preserving.

Closes #732

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-06-06 11:24:48 -04:00
committed by GitHub
parent 42b74100f1
commit ba231ecbfc
117 changed files with 132 additions and 350 deletions

View File

@@ -442,7 +442,7 @@ function resolveBaseRef() {
* security), so every concrete match that pickAffectedTests put into `selected`
* belongs to one of those suites and will be exercised by running all three.
*/
function resolveRunPlan({ changedFiles, selected, widenRequired, criticalPath, noChanges }) {
function resolveRunPlan({ changedFiles: _changedFiles, selected, widenRequired, criticalPath, noChanges }) {
if (noChanges) {
return { mode: 'suite', suite: 'unit' };
}

View File

@@ -17,7 +17,7 @@
const fs = require('node:fs');
const path = require('node:path');
const { parseFragment, FRAGMENT_ERROR } = require('./parse.cjs');
const { parseFragment } = require('./parse.cjs');
const { renderChangelog } = require('./render.cjs');
const { serializeChangelog, parseChangelog } = require('./serialize.cjs');
const { renderGithubReleaseNotes } = require('./github-release-notes.cjs');

View File

@@ -27,7 +27,7 @@
const fs = require('fs');
const path = require('path');
const { execFileSync, spawnSync } = require('child_process');
const { spawnSync } = require('child_process');
// On Windows, npm ships as npm.cmd (a batch wrapper); spawnSync without
// shell:true requires the exact filename including extension.

View File

@@ -11,8 +11,7 @@
// Exit 0 = merged cleanly (or merge was a no-op).
// Exit 1 = merge conflict or fetch failure.
const { execFileSync, execSync } = require('child_process');
const path = require('path');
const { execFileSync } = require('child_process');
function run(cmd, args, opts) {
try {
@@ -50,11 +49,9 @@ if (token && repo) {
}
// Fetch base branch with retry.
let fetched = false;
for (let attempt = 1; attempt <= 3; attempt++) {
const result = run('git', ['fetch', 'origin', baseBranch]);
if (result) {
fetched = true;
break;
}
if (attempt === 3) {

View File

@@ -3,7 +3,6 @@
const { execFileSync } = require('child_process');
const { existsSync, readdirSync, appendFileSync } = require('fs');
const { join } = require('path');
const RULES = [
{

View File

@@ -133,7 +133,7 @@ function checkAgent(profile) {
return ['agent file not found: ' + agentPath];
}
const { fields, body } = parseAgentFile(agentPath);
const { fields } = parseAgentFile(agentPath);
const fullContent = fs.readFileSync(agentPath, 'utf8');
// (a) frontmatter fields

View File

@@ -30,7 +30,7 @@ const DRY_RUN = process.argv.includes('--dry-run');
const ROOT = path.join(__dirname, '..');
const COMMANDS_DIR = path.join(ROOT, 'commands', 'gsd');
const AT_PATH_PATTERN = /@(?:~|\$HOME)\/.+?gsd-core\/[^\s`\)]+/;
const AT_PATH_PATTERN = /@(?:~|\$HOME)\/.+?gsd-core\/[^\s`)]+/;
const mkAtRe = () => new RegExp(AT_PATH_PATTERN.source, 'g');
function transformLine(line) {

View File

@@ -96,9 +96,6 @@ function removeResolverLines(lines, preamble) {
const result = [];
let i = 0;
// Build a set of preamble lines for fast lookup (to strip previously-inserted preambles)
const preambleLineSet = new Set(preamble);
while (i < lines.length) {
const line = lines[i];
const trimmed = line.trim();