fix(#551): lint hand-written bin/lib/*.cjs mislabeled as generated (#555)

* fix(#551): lint hand-written bin/lib/*.cjs mislabeled as generated

GENERATED_CJS_IGNORES excluded 12 hand-written runtime modules from the
ADR-452 ESLint harness. None carry an @generated header and no generator
emits them — they are hand-written, not generated. Remove the mislabeled
list so they lint like the rest of get-shit-done/bin/**/*.cjs. The genuinely
tsc-generated semver-compare.cjs keeps its own separate ADR-457 ignore.

Also drop the stale "Type-aware via parserOptions.project=tsconfig.lint.json"
comment on the .cjs block: that block sets no parser/project and enables no
@typescript-eslint rules; type-aware linting lives in the src/**/*.cts block.

Lint stays green (0 errors); 2 pre-existing warnings surface (already warn
severity) per the file's warn-first convention, tracked as follow-up cleanup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test(#551): guard ESLint coverage of hand-written bin/lib/*.cjs

Asserts via ESLint's isPathIgnored API that every get-shit-done/bin/lib/*.cjs
without an @generated header or a src/<name>.cts|.ts source is linted (not
ignored), and that the genuinely tsc-generated semver-compare.cjs stays
ignored (ADR-457). Fails 13/14 against the pre-fix config; passes on the fix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-05-31 20:04:03 -04:00
committed by GitHub
parent de2f73d21a
commit 01f894078d
2 changed files with 94 additions and 18 deletions

View File

@@ -22,22 +22,6 @@ const localPlugin = {
},
};
// Generated bin/lib files — never lint
const GENERATED_CJS_IGNORES = [
'get-shit-done/bin/lib/command-aliases.cjs',
'get-shit-done/bin/lib/configuration.cjs',
'get-shit-done/bin/lib/decisions.cjs',
'get-shit-done/bin/lib/phase-lifecycle.cjs',
'get-shit-done/bin/lib/plan-scan.cjs',
'get-shit-done/bin/lib/project-root.cjs',
'get-shit-done/bin/lib/schema-detect.cjs',
'get-shit-done/bin/lib/secrets.cjs',
'get-shit-done/bin/lib/state-document.cjs',
'get-shit-done/bin/lib/validate.cjs',
'get-shit-done/bin/lib/workstream-inventory-builder.cjs',
'get-shit-done/bin/lib/workstream-name-policy.cjs',
];
const sdkSrcExists = existsSync(join(__dirname, 'sdk', 'src'));
export default tseslint.config(
@@ -53,7 +37,6 @@ export default tseslint.config(
'**/*.generated.cjs',
// ADR-457: tsc-generated runtime artifact — lint the src/*.cts source, not the emitted .cjs.
'get-shit-done/bin/lib/semver-compare.cjs',
...GENERATED_CJS_IGNORES,
],
},
@@ -77,7 +60,6 @@ export default tseslint.config(
// ── get-shit-done/bin/**/*.cjs + scripts/**/*.cjs ───────────────────────────
// CommonJS Node files: js.recommended + eslint-plugin-n + local plugin rules
// Type-aware via parserOptions.project=tsconfig.lint.json where applicable
{
files: ['get-shit-done/bin/**/*.cjs', 'scripts/**/*.cjs'],
plugins: {