Effective TypeScript: 62 Specific Ways to Improve Your TypeScript
This is the code sample repo for Effective TypeScript: 62 Specific Ways to Improve Your TypeScript. The book is available through:
You can get the latest updates on the book at https://effectivetypescript.com.
Below you'll find a complete table of contents with links to standalone code samples for each item. All code samples 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
strictsetting. These were produced and checked using literate-ts and TypeScript 3.7.0-beta. You may want to copy/paste them into the TypeScript playground.
Chapter 1: Getting to Know TypeScript
Chapter 2: TypeScript’s Type System
Chapter 3: Type Inference
Chapter 4: Type Design
Chapter 5: Working with any
Chapter 6: Types Declarations and @types
Chapter 7: Writing and Running Your Code
Chapter 8. Migrating to TypeScript