Home

Awesome

<img src="/cover.jpg" width="286" title="Second Edition Cover Image" align="right">

Effective TypeScript

This is the code sample repo for the Effective TypeScript: 83 Specific Ways to Improve Your TypeScript (O'Reilly, May 2024). The book is available through:

and others. You can get the latest updates on the book at effectivetypescript.com.

Still on the first edition? Check out the 1st-edition branch.

Code Samples

Below you'll find a complete table of contents. Each item links to a page with its "Things to Remember" (a short summary of the item) and a listing of all its code samples. The code samples are accompanied by links to the TypeScript playground. They should produce the expected errors (and no others) and expected types.

Unless otherwise noted in a comment at the top of the code sample, the samples are run with TypeScript's strict setting. These were produced and checked using literate-ts and TypeScript 5.4.5.