During the last two years, ESM support in TypeScript, Node.js and browsers has made a lot of progress. In this blog post, I explain my modern setup that is relatively simple – compared to what we had to do in the past:
JavaScript’s Arrays are so flexible that TypeScript provides two different kinds of types for handling them:
Array<string>
[number, string, boolean]
In this blog post, we look at the latter – especially how to compute with tuples at the type level.
In this blog post, we take a closer look at template literal types in TypeScript: While their syntax is similar to JavaScript’s template literals, they operate at the type level. Their use cases include:
The ECMAScript proposal “RegExp escaping” (by Jordan Harband and Kevin Gibbons) specifies a function RegExp.escape()
that, given a string text
, creates an escaped version that matches text
– if interpreted as a regular expression.
In this blog post, we take a closer look at TypeScript enums:
The blog post concludes with recommendations for what to use when.
tsconfig.json
I never felt confident about my tsconfig.json
. To change that, I went through the official documentation, collected all common options, and documented them in this blog post:
This knowledge will enable you to write a tsconfig.json
that is cleaner and that you’ll fully understand.
If you don’t have the time to read the post, you can jump to the summary at the end where I show the tsconfig.json
that I use now – along with recommendations for adapting it to different use cases (npm package, app, etc.).
I also link to the tsconfig.json
recommendations by several well-known TypeScript programmers. (I went through them when I researched this post.)
I’m curious what your experiences with tsconfig.json
are: Do you agree with my choices?
Traditionally, we could only apply regular expression flags such as i
(for ignoring case) to all of a regular expression. The ECMAScript feature “Regular Expression Pattern Modifiers” (by Ron Buckton) enables us to apply them to only part of a regular expression. In this blog post we examine how they work and what their use cases are.
Regular expression pattern modifiers attributes reached stage 4 in October 2024 and will probably be part of ECMAScript 2025.
The ECMAScript feature “Import Attributes” (by Sven Sauleau, Daniel Ehrenberg, Myles Borins, Dan Clark and Nicolò Ribaudo) helps with importing artifacts other than JavaScript modules. In this blog post, we examine what that looks like and why it’s useful.
Import attributes reached stage 4 in October 2024 and will probably be part of ECMAScript 2025.
Starting with v23.6.0, Node.js supports TypeScript without any flags. This blog post explains how it works and what to look out for.
In this blog post, we look at how WebAssembly has become an ecosystem for many programming languages and what technologies enable that.