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:
@@ -9,7 +9,6 @@ const { test, describe, beforeEach, afterEach } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
const { execSync } = require('child_process');
|
||||
const { runGsdTools, createTempProject, createTempDir, cleanup } = require('./helpers.cjs');
|
||||
const { detectChildRepos } = require('../gsd-core/bin/lib/init.cjs');
|
||||
@@ -328,7 +327,7 @@ describe('workspace command files', () => {
|
||||
function parseCommandFile(filePath) {
|
||||
// Strip UTF-8 BOM if present (some editors inject on save under Windows);
|
||||
// a BOM byte at offset 0 defeats the ^--- anchor, making fmMatch null.
|
||||
const raw = fs.readFileSync(filePath, 'utf8').replace(/^/, '');
|
||||
const raw = fs.readFileSync(filePath, 'utf8').replace(/^\ufeff/, '');
|
||||
const fmMatch = raw.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/);
|
||||
assert.ok(fmMatch, `${path.basename(filePath)} must start with a YAML frontmatter block`);
|
||||
const fm = {};
|
||||
|
||||
Reference in New Issue
Block a user