Inside [ci-failure] TypeScript Type Check Failures
The CI pipeline’s sudden crash over BackToTop.astro and ReadingProgress.astro isn’t a bug - it’s a warning: TypeScript’s narrowing logic missed null risks in event handlers. For btn, bar, and container - all guarded by early exits - the inner functions still risk null, triggering 18047 errors. Fix by guarding each closure explicitly: btn!.classList.toggle('visible', visible); and bar!.style.width = ${progress}%; - no more guessing. In about.astro, a hidden any type in recentPosts.map() let TypeScript fall back to unsafe inference - explicit (CollectionEntry<'posts'>) => ends the confusion. Meanwhile, structured-data.ts tried to spread union types directly, a no-go in TS; the fix? stick with Object.assign - it’s the safe, idiomatic path. These fixes don’t change behavior - they harden the codebase. With npm run check now clean, the pipeline breathes easier. But here’s the real test: are we treating these warnings as hygiene, or just a cleanup chore? The next time your build fails, remember - null isn’t silent, and TypeScript’s watching. How often do you let silent type errors slip into your main flow?