Book: TypeScript Essentials — From Working Developer to Confident TS, Across Node, Bun, Deno, and the Browser
Also by me: The TypeScript Library — the 5-book collection
My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools
Me: xgabriel.com | GitHub
You add a new status to your app. The string "archived" goes
into a constant array at the top of the file, and a switch
statement in the reducer handles the new case. CI is green. You
ship.
Two days later a teammate adds "deleted" to the array and
forgets the reducer. The compiler does not flag it. The status
list is typed as string[] . The reducer parameter is typed as
string . Every status in the world satisfies that signature.
The bug ships behind a feature flag. Nobody catches it for a
week, until a customer ticket arrives asking why deleted items
still appear in the active list.
That bug is one keyword away from impossible. The keyword is
as const .…