← ClaudeAtlas

dhpk-js-static-check-strategylisted

Progressive `// @ts-check` per-leaf rollout playbook for legacy JS bundles. Covers the three-list legacy-globals sync (ESLint globals / TypeScript ambient .d.ts / JSDoc typedef), tsconfig exclude strategy for type-check-resistant files, leaf classification (typedef-widening-fixable vs permanent-exclude), line-anchored progress-grep traps, and Phase-2 exit-gate semantics. Use when planning a per-leaf cleanup PR, introducing a new leaf-level global, editing tsconfig's exclude list, interpreting /ts-check-status output, or validating the strict-checkJs exit gate. Not for everyday JavaScript feature work or isolated lint-rule lookups; use the sibling dhpk-js-lint-config and references/static-checks.md for those. Output: a per-leaf classification, three-list change set, and exit-gate evidence.
hmj1026/dhpk · ★ 2 · Code & Development · score 71
Install: claude install-skill hmj1026/dhpk
# JS static-check strategy — progressive rollout playbook > Always-loaded SSOT rule: `modules/js/references/static-checks.md`. This skill carries the long-form execution detail so the always-loaded rule stays short. Load this when you are actually doing the rollout work. ## Legacy-globals — three-list sync When a leaf introduces a new global, **all three lists must update together** (no automatic derivation — three independent maintained files): 1. **`eslint.config.js`** `<projectName>LegacyGlobals` constant — readonly / writable annotation. SSOT for `no-undef`. 2. **`<frontend-root>/<project>-ambient.d.ts`** — `declare var X: any;` block. SSOT for `tsc --noEmit` bare-identifier resolution. 3. **`<frontend-root>/jsdoc-globals.js`** — `@typedef` (only when the default `any` from the ambient `.d.ts` is too loose and a real shape adds value). A leaf PR that misses any of the three surfaces later as `no-undef` or TS2304. CI catches drift after the fact; reviewers should still verify three-way sync proactively. ## `// @ts-check` progressive strategy - One leaf per PR: add `// @ts-check` + clean up the JSDoc + run the unit / contract tests to confirm no regression. - Track the rollout against your mechanical-extraction cadence (Stage A, B, C…). Each stage produces a batch of leaves ready for type-check enablement. - A stuck leaf can land `// @ts-nocheck` with a TODO comment as a transitional state — but every transitional file should have a tracked exit