About

About JS with Types

An independent reference for writing JavaScript that TypeScript can check, with no build step.

What this site is

JS with Types documents one way of working: plain .js files, types written as JSDoc comments, and TypeScript's checker run over them through a jsconfig.json. Nothing is compiled; the files you write are the files that run.

The reference covers the JSDoc tags and type expressions TypeScript reads, the config options that matter for JavaScript, the errors you will meet, editor setup and what each TypeScript release changed. Recipes answer specific how-do-I questions, the guides cover the ideas and the decisions behind them, the comparisons set checked JavaScript next to its alternatives, and the tools do the setup work.

How big it is

As of this build, the site has 346 pages: 244 reference pages, 8 quick-start setups, 58 recipes, 10 guides, 6 comparisons and 2 tools, plus the listings and the pages about the site. Its code examples are 1011 files in 750 example projects, checked with TypeScript 5.9.3 on 21 October 2026; the failing ones produce 563 expected errors between them. These numbers are counted from the site's own data every time it is built.

How the examples are checked

Every code example is a real file in the site's source, in a small project of its own with the jsconfig.json it needs (and a tsconfig.json when the page shows a TypeScript version beside it). Every build runs TypeScript's checker over every one of those projects, the same way tsc -p would:

  • An example that should pass must produce no errors at all.
  • An example that shows an error carries a marker on the line above the one TypeScript should flag. The build fails unless TypeScript reports exactly that error code on exactly that line, and nothing else anywhere in the project. The marker is hidden on the page; the message under the line is the one tsc printed.
  • Every JavaScript file in an example must actually be checked, so an example cannot pass by being skipped.
  • For examples that publish types, the .d.ts files TypeScript writes must equal the ones shown, so the output on the page is what TypeScript writes today.
  • Each error page must show a failing example with its own code, and a fix whose example passes.

The badge on each example shows the TypeScript version it was checked with and the day of the check. The pages are currently checked with TypeScript 5.9. If a TypeScript release changes a result, the build fails until the page is corrected. Statements about tools the build does not run (editors, runtimes, other checkers, newer TypeScript versions) say so and name their source, such as the tool's documentation or a dated one-off run.

Who it is for

  • Developers who want type checking without adding a compile step to their project.
  • Teams moving an existing JavaScript codebase toward types, one file at a time.
  • TypeScript users who still keep JavaScript files: config files, scripts, tests.
  • Contributors to projects that type their source with JSDoc comments.

Independent

JS with Types is an independent site. It is not affiliated with Microsoft or the TypeScript team, with the JSDoc project, or with the author of the 2022 talk that first used this domain (where the name comes from). TypeScript is a trademark of Microsoft Corporation.

Corrections

If something here is wrong, or out of date for a newer TypeScript, tell us. Corrections are the most useful mail this site gets.

Last updated 21 October 2026.