Skip to main content

Advanced TypeScript: Generics, Types and Go Compiler

Advanced TypeScript: conditional generics, mapped types, template literal types, type-level programming, the new Go compiler, and migration strategies for enterprise codebases.

This series collects 6 articles (approximately 80 minutes of total reading time), designed for a level Advanced. The main topics covered are TypeScript, generics, types, compiler.

6Articles80 minTotal reading timeAdvancedLevel
TypeScriptgenericstypescompilerenterprise

Series Articles

  1. 1

    01 - Strict Mode Is Not Enough: 100 Type Breaches in a 100% Strict TypeScript Monorepo

    strict, strictTemplates, and strictInjectionParameters all on, yet 54 ': any' and 46 'as any' survive across 3884 files.

  2. 2

    02 - unknown instead of any: the boundary where data enters the program

    On a boundary, nobody checks the type you wrote. unknown makes it checkable: real compiler errors and the honest cost of the choice.

  3. 3

    03 - Type guards: how to teach a type to the compiler (and when it lies)

    typeof, instanceof, in and type predicates. With the hole nobody names: the compiler verifies a guard's signature, not its body.

  4. 4

    04 - Discriminated union: making impossible states unwritable

    One boolean and two optional fields allow eight states, and four mean nothing. How to make them inexpressible and get warned when the union grows.

  5. 5

    05 - satisfies: checking a catalog without losing its keys

    Annotating an object literal with an interface costs you the list of its keys. The compiled proof, the real error and the rule for choosing.

  6. 6

    06 - Template literal types: a storage key the compiler composes

    Two concatenated string parameters are two typos that compile. How to describe the shape of a key and have it checked, with the compiler's real errors.

Test your knowledge!

Have you read all the articles? Check how much you've learned by taking this series' quizzes.

Take the quiz!