← ClaudeAtlas

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 files that resist type-check, 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 that the strict-checkJs exit gate is met. For day-to-day lint-rule lookups, the sibling skill js-lint-config and the references/static-checks.md index are enough.
hmj1026/dhpk · ★ 1 · Code & Development · score 74
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