TypeScript
Concise TypeScript, TS Handbook & Effective Typescript Book are great intros. So as Execute Program, Type-Level TypeScript or Total TypeScript courses. Type Challenges is a nice test for TS knowledge.
TypeScript Error Translator is nice.
Run TS with Bun and deploy HTTP services with Hono.
stc's TS type checker in Rust is exciting.
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.unknown
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. (HN)
- 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)
- TypeScript is terrible for library developers (2022) (HN)
- Best Practices for TypeScript Monorepo (HN)
- Total TypeScript - Tutorial on transforming types in TypeScript. (Code) (Code)
- Generics in TypeScript: a deep dive
- Mega thread on learning TS
- Prakaar - Type programming language which compiles to and interops with type-level TypeScript.
- Civet - CoffeeScript of TypeScript.
- Building Complex Types in TypeScript (2022)
- TypeScript Typelevel Tic-Tac-Toe: Overkill edition (2022)
- Learn how to unleash the full potential of the type system of TypeScript (HN)
- TDungeon - Adventure game that runs in the Typescript type system.
- Ezno: a new TypeScript compiler (HN)
- TypeScript Tips by Matt Pocock
- Total TypeScript - Professional TypeScript Training by Matt Pocock.
- TypeRunner - High-performance TypeScript compiler. (Tweet)
- Improve DX tips for TypeScript projects (2022)
- TinySource - Completely free TypeScript one-file source code snippets with tests, which can be copied to avoid extra dependencies.
- Intermediate to Advanced TypeScript (2022)
- stc - Speedy TypeScript type checker.
- transformer-query - Next-generation typescript transformer.
- TypeScript compiler PR to be implemented internally with modules (HN)
- Assembly interpreter inside of TypeScript's type system (2022) (Code)
- Discriminated Unions in Typescript (2022)
- Collection of patterns for TypeScript 4.9
- Rewriting TypeScript in Rust? (2022) (HN)
- TS Enums considered harmful (2022)
- All I want for Christmas is these seven TypeScript improvements (2022) (HN)
- Ask HN: What are the best open source TypeScript projects I can learn from? (2023)
- Immutability: what a monster (2023) (Tweet)
- eject-enum - Automatic code rewriting tool for TypeScript codebases that rewrites each TypeScript enum in your codes to the safer alternative.
- TypeScriptAST - Build TypeScript AST from Swift API.
- Structure of a TypeScript Error (2023) (Tweet)
- Ask HN: Is TypeScript worth it? (2023)
- TypeScript 5.0 Beta (2023) (Reddit)
- TypeScript utility types you need to know
- ts-reset - 'CSS reset' for TypeScript, improving types for common JavaScript API's. (Tweet) (HN)
- Linting TypeScript in 2023
- I Made These TypeScript Mistakes For Years (2023)
- Ezno - JavaScript compiler and TypeScript checker written in Rust with a focus on static analysis and runtime performance.
- ArkType - Isomorphic types for TS/JS. (Web)
- TypeScripting the Technical Interview (2023) (HN)
- JavaScript and TypeScript features of the last 3 years (2023) (HN)
- TypeScript 5.0 (2023) (HN) (Reddit)
- ValueScript - Dialect of TypeScript with value semantics.
- Implementing the Pipe Operator in TypeScript (2023)
- Functional Programming with TypeScript's Type System (HN)
- Acorn TypeScript - Alternative, TypeScript parser.
- Typescript Tools That Make You Productive (2023)
- TypeScript neat tricks
- Macro-ts - TypeScript compiler with typesafe syntactic macros. (HN)
- TypeScript 5.1 (2023)
- Aleksandra Sikora - Typescript Performance: Going Beyond The Surface (2023)
- TypeScript 5.2's New Keyword: 'using' (HN)
- Succulent - Powerful and easy runtime type checking.
- Why doesn't TypeScript properly type Object.keys? (2023) (HN)
- typescript-error-deltas - Test popular repos on new versions of TypeScript: display new compiler errors.
- TypeScript 5.2 Beta (2023)
- Concise TypeScript (HN)
- TypeScript errors and how to fix them (Code)
- TypeScript Is Surprisingly OK for Compilers (2023) (HN)
- Type Hero - Connect, collaborate, and grow with a community of TypeScript developers. (Code)
Images
TypeScript’s type hierarchy