TypeScript
TS Handbook & Effective Typescript Book are great intros. So as Execute Program & Advanced TypeScript courses too. Type Challenges is a nice test for TS knowledge.
TypeScript Error Translator is nice.
Run/bundle TS with Bun.
Notesâ
- TypeScript can figure the return type out by looking at the return statements, so we can also optionally leave this off in many cases
- You really shouldnât use arrow function as class members. Arrow functions are duplicated in memory for each class instance, while proper method members are written once in your classâs prototype and shared between all instances.
- Unlike classes, an interface is a virtual structure that only exists within the context of TypeScript. The TypeScript compiler uses interfaces solely for type-checking purposes.
any
means âignore the typeâ,unknown
means âwe donât know the typeâ, which arenât the same thing, and for better code youâd rather not know the type than ignore it.- You canât use
unknown
as a simple replacement forany
, that wouldnât make sense.unkwnown
carries the implication that you should not use this variable other than passing it around. Or testing its type to get rid of the âunknownâ state. - Tuples are very useful for simulating multiple returns like React hooks, and other combined values that don't need string object keys
- TS generics are basically functions that you invoke with <> instead of ()... but without optional named param support... and a lot of other things that I would expect from a "function"
- If itâs hard to type via TypeScript, I should probably rethink my design.
- Properly name your generics. Generics are basically functions you give to developers to create parameterized types.
noUncheckedIndexAccess
config option is usefulStrictNullChecks
config option is useful- Most TS devs want to get better at: 1. Quickly debugging/understanding complex TS errors. 2. Relying more on inference than declaration. 3. Removing any's from their codebase with smarter types.
Linksâ
- TypeScript Language Specification
- TypeScript code
- TypeScript Handbook
- React & Redux in TypeScript - Static Typing Guide
- Opening Remarks by Anders Hejlsberg (2018)
- Ultimate React Component Patterns with Typescript 2.8
- Very opinionated front end boilerplate
- Babel 7 + TypeScript
- Classes vs interfaces in TS
- StREST - Set up tests for REST in seconds with YAML.
- Fork TS Checker Webpack Plugin - Webpack plugin that runs typescript type checker on a separate process.
- Tsickle - TypeScript to Closure Translator.
- Set of TSLint rules used on some Microsoft projects
- TypeScript ESLint - Monorepo for all the tooling which enables ESLint to support TypeScript.
- TypeScript With Babel: A Beautiful Marriage (2018)
- ts-node-dev - Restarts target node process when any of required files changes (as standard node-dev) but shares Typescript compilation process between restarts.
- When to use
never
andunknown
in Typescript (2019) - bibliography on Gradual Typing
- dtslint - Tests a TypeScript declaration file for style and correctness.
- Clean Code concepts adapted for TypeScript
- SonarTS - Static code analyzer for TypeScript.
- TypeScript TSLint Language Service Plugin
- TypeScript Guidelines - Guideline to focus on how to write effective TypeScript with minimal effort.
- Practical Advanced TypeScript
- typescript-json-schema - Generate json-schemas from your Typescript sources.
- tslint-config-security - TSLint security rules.
- TypeScript Definition Style Guide
- Conditional Type Checks - Types for testing TypeScript types.
- quicktype - Generate types and converters from JSON, Schema, and GraphQL.
- Collection of essential TypeScript types
- Be Super with TypeScript and Jared Palmer episode (2019)
- typesync - Install missing TypeScript typings for dependencies in your package.json.
- TSdx - Zero-config CLI for TypeScript package development.
- Programming TypeScript Book by Boris Cherny (2019)
- OneFraction - React/ApolloGraphQL/Node/Mongo demo written in Typescript.
- TypeScript 3.0: The unknown Type (2019)
- Lobsters: What have you learned from adopting Typescript into an existing JS codebase? (2019)
- React+TypeScript Cheat Sheets (Web)
- Using Typescript to make invalid states irrepresentable
- High-level notes about TypeScript
- TypeCov - Track missing type coverage to ensure type safety.
- type-coverage - CLI tool to check type coverage for typescript code.
- TSDoc Standard - Standard but also use TypeScript on JS files with jsdoc.
- Typescript Generics Tutorial (2019)
- ts-morph - TypeScript Compiler API wrapper. Provides an easier way to navigate and manipulate TypeScript and JavaScript code.
- tsconfig-paths - Load node modules according to tsconfig paths, in run-time or via API.
- ts-json-schema-generator - Generate JSON schema from your Typescript sources.
- TSQuery - Allows you to query a TypeScript AST for patterns of syntax using a CSS style selector system.
- Interpreting TypeScript (Article)
- TSDX - Zero-config CLI for TypeScript package development. (CLI)
- TypeScript Weekly - Best TypeScript links every week, right in your inbox. (Archive)
- Rush Stack - Reusable tooling for large scale TypeScript monorepos. (Web)
- Debugging the TypeScript Codebase (2019)
- The ultimate explanation of TypeScript generics: functions (2019)
- TypeScript 3.7 Utility Types Cheat Sheet
- TypeScript Generics for People Who Gave Up on Understanding Generics (2019)
- Blogged Answers: Learning and Using TypeScript as an App Dev and a Library Maintainer (2019)
- Runtypes - Runtime validation for static types.
- Stringly and Strongly typed TypeScript (2019)
- Type Families in Typescript (2019)
- TSConf 2019 Keynote - Anders Hejlsberg
- Effective Typescript Book (Code)
- Effective Typescript notes
- TypeScript for Beginner Programmers
- TSConf Videos
- gts - TypeScript style guide, formatter, and linter by Google.
- Typing correctly matters (2019)
- Is TypeScript worth it? (2020) (HN)
- React with TypeScript: Best Practices (2020)
- dts-gen - TypeScript Definition File Generator.
- Nimbus - Centralized CLI for JavaScript and TypeScript developer tools.
- Naive approach to functional programming using TypeScript
- Meta-Typing - Various functions and algorithms implemented purely with TypeScript's type system.
- Designing the perfect Typescript schema validation library
- How to setup TypeScript and use in a normal JavaScript project for learning purposes
- Dependent Types in Typescript
- Type Puzzles - Learn TypeScript with Type Puzzles. (Code)
- Introduction to Functional Programming using TypeScript and fp-ts
- TypeScript Website Code - Website and web infrastructure for learning TypeScript. (Updates Issue)
- Functional TypeScript - TypeScript standard for rock solid serverless functions.
- TSJS-lib-generator - TypeScript and JavaScript lib generator.
- TypeScript exercises - Collection of challenging TypeScript exercises.
- sane-fmt - Opinionated code formatter for TypeScript and JavaScript.
- Benchmark Comparison of Packages with Runtime Validation and Typescript Support
- TypeScript Language Server
- TypeScript Playground Collaborate
- Centralized Recommendations for TSConfig bases
- Typescript Data Structures and Algorithms - Collection of classic data structures and algorithms implemented in Typescript with video lectures.
- TypeDoc - Documentation generator for TypeScript projects. (Web)
- Advanced TypeScript Types cheat sheet (with examples) (2020)
- TypeScript interactive course
- ts-migrate - Tool to automatically migrate JavaScript projects to TS. (HN)
- Exhaustive matching in TypeScript (2020)
- TypeScript for Professionals (2020) (Code)
- The Single-Valued Type Pattern for TypeScript (2020)
- TypeScript in 50 Lessons book
- TypeScript notes/links
- Data Constructors, Part 1: Understanding by Implementing (2020)
- TypeScript: accessing members of a union type (2020)
- PlayCode - JavaScript/TypeScript Playground.
- Utilities for TypeScript and Bazel
- End-to-End TypeScript: Database, Backend, API, and Frontend (2020)
- TypeScript Transformer Handbook
- How does the TypeScript team try to avoid negative effects on the JS ecosystem? (2020)
- TypeChallenges - Collection of TypeScript type challenges with online judge. (Solutions) (Solutions Code)
- Insights from Adopting TypeScript at Scale (2020) (Tweet) (HN)
- TypeScript splits the atom A first look at TS 4.1's new template literal types (2020)
- TypeScript Coverage Report - Node command line tool for generating TypeScript coverage reports.
- ts-unused-exports - Finds unused exported symbols in your Typescript project.
- Learn TypeScript: A Pocketguide Tutorial (2020)
- TypeScript 4.1 (2020) (HN)
- ts-monorepo - Template for setting up a TypeScript monorepo.
- Tips for Performant TypeScript (HN)
- A case study on strict null checks (2020) (HN)
- TypeScript LSIF indexer
- ttypescript (Transformer TypeScript) - TypeScript tool to use custom transformers in the tsconfig.json.
- json2ts - Generate TypeScript interfaces from JSON.
- Go JSON to TypeScript model converter
- Using fetch with TypeScript (2021)
- Bad TypeScript Habits (HN)
- TypeScript Function Syntaxes (2021)
- How an Anti-TypeScript âJavaScript developerâ like me became a TypeScript fan (2021) (HN)
- User-defined type guards in TypeScript (2021)
- How to write a Constrained Identity Function (CIF) in TypeScript (2021)
- Mostly Adequate Guide for the fp-ts library
- Type-Level Programming in TypeScript (2021)
- TypeScript Strictly Typed - Enable configurations for strictly typed TypeScript, ESLint or TSLint.
- Type Gymnastics - Collection of wonderful TypeScript type gymnastics code snippets.
- swc-node - Faster ts-node without type check.
- vite-plugin-ts-checker - Vite plugin that runs TypeScript type checker on a separate process.
- Oh no, I have to add those stupid TypeScript types (2021)
- Unirepo - Extremely opinionated TypeScript monorepo tool.
- DTS Bundle Generator - Small tool to generate a dts bundle from your ts code.
- Starting a TypeScript Project in 2021 (HN)
- Advanced TypeScript Fundamentals (2021)
- Writing better TypeScript (2021) (Reddit)
- Advanced Typescript Types (2021)
- TypeScript Needs to Emit Runtime Type Information (Code)
- types-sync - Keep your types in sync with DefinitelyTyped - auto install/uninstall types for dependencies on postinstall.
- TypeStat - Converts JavaScript to TypeScript and TypeScript to better TypeScript.
- Functional TypeScript in Production Systems (2021)
- TypeScript: Sorting out tsconfig (2021)
- The Seven Sources of Unsoundness in TypeScript (2021)
- Bundling TypeScript With Esbuild for NPM
- mini-typescript - Miniature model of the Typescript compiler, intended to teach the structure of the real Typescript compiler.
- Shiki Twoslash - Static Code Samples for JS Projects. (Code)
- esbuild-node-loader - Transpile TypeScript to ESM with Node.js loader.
- Building an end-to-end typesafe API â without GraphQL (2021)
- dpdm - Static dependencies analyzer for your JavaScript and TypeScript projects.
- Design Patterns in TypeScript (2021)
- ts-gyb - Generating native code interfaces from TypeScript.
- Tackling TypeScript: Upgrading from JavaScript
- TypeScript Evolution â Marius Schulz
- Optional Chaining: The ?. Operator in TypeScript (Lobsters)
- TypeScript and TSX grammars for tree-sitter
- Practical introduction to algebraic datatypes (ADTs) in TypeScript (2021)
- ts-fix - CLI for applying TypeScript codefixes.
- io-ts-transformer - TypeScript transformer which converts TypeScript types to io-ts entities.
- Awesome TypeScript Ecosystem - List of awesome TypeScript transformers, plugins, handbooks, etc.
- typescript-run - Run TypeScript files at lightning speed.
- Parse, donât validate, incoming data in TypeScript (2021)
- Building an ECS in TypeScript (2021)
- Sindre's tsconfig - Shared TypeScript config for my projects.
- Designing delightful docs with Orta Therox, engineer on Microsoft's TypeScript compiler team (2021)
- tsconfig-to-swcconfig - Convert tsconfig to swc config.
- TypeScript to ES Module compiler
- TypeScript BC - TypeScript with a Borrow Checker. Multi-threaded, Tiny binaries. No GC. Easy to write.
- Tricks I wish I knew when I learned TypeScript (2021) (HN)
- typescript-todo-or-die-plugin - TODO's that speak up for themselves via the TypeScript Language Server.
- Reconstructing TypeScript (2021) (Code)
- TypeScript Native Compiler using LLVM
- ts-strictify - Runs TypeScript in strict mode on your changed files.
- Introduction to TypeScript with Josh Goldberg (2021)
- Making Illegal States Unrepresentable in TypeScript (2021) (Code)
- Stop catching errors in TypeScript; Use the Either type to make your code predictable (2021) (Reddit)
- TypeType - Programming language designed for typescript type generation. (Playground)
- TSCC - Collection of tools to seamlessly bundle, minify Typescript with Closure Compiler.
- TypeScript: Control flow analysis for destructured discriminated unions (HN)
- How the TypeScript Compiler Compiles - understanding the compiler internal (2021)
- Etsyâs Journey to TypeScript (2021) (HN)
- Convert JSON to TypeScript
- Speed up your TypeScript monorepo with esbuild (2021)
- Tame VSCode autoimports in a TS monorepo
- StaticScript - TypeScript compiler on top of TypeScript as frontend and LLVM as backend.
- tsplay.dev - TypeScript Playground Shortener. (Code)
- TypeScript's excess properties can bite you (2021)
- TS Patch - Augment the TypeScript compiler to support extended functionality.
- ts-standardx - Configurable linter for TypeScript and JavaScript.
- macro-ts - Ergonomic typescript compiler that enables typesafe syntactic macros. (Article)
- ts-analyze-trace - Tool for analyzing the output of
tsc --generateTrace
. - Domain Modeling with Typescript (2021)
- Ivan Koshelev's TS articles
- TypeScript: The humble function overload (2021)
- Kretes - Programming Environment for TypeScript & Node.js. (Code)
- dprint-plugin-typescript - TypeScript formatting plugin for dprint.
- TypeScript for Pythonistas (2021) (HN)
- Magic TypeScript - Cheat sheet of TypeScriptâs most important/magic features. (Code)
- TypeScript Functional Architecture - TypeScript Functional Architecture, without using classes.
- TinyCompTS - Tiny JS/TS compiler written in vanilla TS.
- Breaking down TypeScript generic utility type that recursively converted
Date
types into FirestoreTimestamp
types - Practical Functional Programming with Typescript workshop
- TypeScript Compiler Notes
- Template for a TypeScript Language Service Plugin
- ts-browser - Zero-config TypeScript compilation for web browsers.
- typescript/analyze-trace - Tool for analyzing the output of tsc --generateTrace automatically.
- TypeScript Features to Avoid (2022) (HN)
- The Type Hierarchy Tree (2021)
- TS AutoFix - Automatically fix TS Errors when codefixes are available.
- esbuild-dev - Reloading dev server for server side TypeScript projects. Compiles TypeScript real fast.
- TypeScript Wiki (Code)
- An introduction to type programming in TypeScript (2022) (HN)
- Dynamic Static Typing In TypeScript (2021)
- Assertion Functions in TypeScript (2022) (Lobsters)
- TypeScript AST Viewer (Code)
- swno - Typescript simple runtime powered by Swc.
- How to make TypeScript Blazingly Fast (JavaScript/NodeJS)
- Skerrick - REPL-driven development for JavaScript.
- Advanced TypeScript resources (2022)
- A complete guide to TypeScriptâs 'never' type (2022) (HN)
- Type Polymorphic Functions in TypeScript (2022) (HN)
- TypeScript + fp-ts: ReaderTaskEither and React (2021)
- Great TS projects with code to learn from
- A brief walkthrough on how TypeScript implemented Inlay Hints (2022)
- Ultimate TypeScript Thread (2022)
- TypeScript as fast as Rust: TypeScript++ (HN)
- DSL built with TypeScript type system to query structured objects
- Awesome TypeScript Derived Languages
- TypeScript/How the compiler compiles (2022)
- Type-Level TypeScript Workshop
- TypeScript Congress
- TypeScript tips and Tricks with Matt (2022)
- TypeScript and Set Theory (2022)
- TypeScript Error Translator - Translate your TypeScript errors into plain English. (Code)
- SonarJS - Static code analyzer for JavaScript, TypeScript and CSS languages.
- Advanced TypeScript with Matt (2022)
- Literate TS - Statically checks TypeScript code samples in written text (blog posts, books, etc.).
- Ultimate TypeScript - Supercharge your skills with TypeScript by exploring the language.
- tsd-lite - Test your TypeScript types easily.
- Notes on Advanced TypeScript
- Filtering arrays with TypeScript type guards (2022)
- Modern Typescript with Examples Cheat Sheet
- TypeScript 4.7 (2022) (Lobsters)
- Advanced TypeScript - YouTube
- type-trident - Curated list of advanced type level madness.
- TypeScript runtime comparisons
- You Might Be Using Typescript Wrong (2022)
- Just - Zero config TypeScript build and development toolkit. (HN)
- Learning TypeScript Book (Web Code)
- Learning TypeScript | Projects - Hands-on real world projects that will help you exercise your knowledge of TypeScript. (Code)
- Extreme Explorations of TypeScript's Type System (HN)
- Matt's Advanced TypeScript workshop
- HypeScript - Simplified TypeScript type system in TypeScript's own type system. (HN)
- What's TypeScript compiling? Use a treemap to find out. (2022)
- Unlocking type-safety superpowers in Typescript with nominal and refinement types (2022)
Imagesâ
TypeScriptâs type hierarchy