Part 06 · Readiness · 6.4

Sai lầm và checklist JavaScript/TypeScript

Type checker không sửa runtime races/security; framework không xóa semantics của language, browser và shipped bundle.

Red flags

Giải thích async chỉ bằng “single thread” và bỏ task/microtask/host APIs.
Dùng JSON.parse(...) as Type, any hoặc non-null assertion thay runtime validation.
Lưu secret/token dài hạn trong localStorage hoặc coi CORS là authorization.
Mutate shared module/object state và shallow copy rồi tưởng immutable.
Promise floating, timeout không abort, stale response ghi đè state mới.
Tối ưu theo dev bundle/microbenchmark, không RUM/profile/shipped artifact.

Checklist

Definition of Done

Pass gate: checklist chỉ đạt khi reviewer có thể tái chạy một failure fixture và thấy control sau fix; không chấp nhận output puzzle không có runtime/version context.