Module Option in tsconfig
The module option controls how TypeScript emits import and export statements. Learn the difference between CommonJS, ESNext, nodenext, and preserve, and how to pick the right one.
Type-safe JavaScript with TypeScript
The module option controls how TypeScript emits import and export statements. Learn the difference between CommonJS, ESNext, nodenext, and preserve, and how to pick the right one.
Learn how to read, understand, and fix the most common TypeScript compiler errors. From 'is not assignable' to 'cannot find module', decode what tsc is telling you.
Learn how TypeScript types every DOM element so your editor knows exactly which properties and methods are available at each node.
Learn how to type querySelector and querySelectorAll in TypeScript using generics, tag name inference, and null narrowing.
Learn how to type event handler parameters in TypeScript so the compiler knows which properties exist on click, input, keyboard, and other DOM events.
Learn how to type HTML forms, form fields, and named element access in TypeScript so you can collect and validate user input safely.
Learn how to read and type input values in TypeScript. Handle .value, .checked, .valueAsNumber, .valueAsDate, and different input types correctly.
Learn how TypeScript types the dataset property on HTML elements. Understand DOMStringMap, camelCase conversion, and how to read and write data attributes safely.
Learn how TypeScript types the localStorage API. Understand the Storage interface, string-only values, null handling, and patterns for typed get/set wrappers.
Learn how to type fetch API responses in TypeScript. Handle Response, json(), error states, and typed API wrappers for safe browser requests.
Learn how to build a fully typed HTML form in TypeScript that reads, validates, and submits user input with compile-time safety from start to finish.
Learn the most common TypeScript mistakes when working with the DOM: forgetting null checks, using wrong event properties, and misusing type assertions.