TypeScript
Practical tutorials for the work we actually do. Pick one, read it in order, and apply it.
Write a conditional type with infer that takes the value out of a promise and see how it differs from Awaited. After this, you can read the value type of an async function without writing it by hand.
Freeze a lookup table with as const and derive its keys and values as types. After this, the table and the type that describes it can never drift apart.
Convert one JavaScript module, catch a lost runtime guard, and verify an unchanged JavaScript caller against the emitted TypeScript build.
Reproduce a project-only build that consumes stale shared declarations, rebuild the graph, and verify that an API change reaches its consumer.
Check a config object against a type with satisfies and keep its precise keys and literal values. After this, a typo in a key is caught and the object still autocompletes.
Count the files tsc reads, narrow the include list and turn on incremental with a cache file. After this, you know which change made the build faster because you measured it.
Turn a route pattern into a type that finds the parameter names and checks the paths you pass. After this, a typo in a route or a missing parameter is a compile error.
Write a declaration file for a JavaScript helper with a generic function and an overload, then test it with a short file. After this, calls to the helper are checked and the JavaScript stays as it is.