2ality – JavaScript and more
ECMAScript feature: regular expression pattern modifiers
ECMAScript feature: regular expression pattern modifiers
2Ality
ECMAScript 2025 feature: regular expression pattern modifiers
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.…
🤬1
2ality – JavaScript and more
A checklist for your <code>tsconfig.json</code>
A checklist for your <code>tsconfig.json</code>
2Ality
A guide to `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…
🤬1
2ality – JavaScript and more
TypeScript enums: use cases and alternatives
TypeScript enums: use cases and alternatives
2Ality
TypeScript enums: use cases and alternatives
In this blog post, we take a closer look at TypeScript enums: How do they work? What are their use cases? What are the alternatives if we don’t want to use them? The blog post concludes with recommendations for what to use when.
🤬1
2ality – JavaScript and more
ECMAScript proposal: RegExp escaping
ECMAScript proposal: RegExp escaping
2Ality
ECMAScript 2025 feature: RegExp escaping
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. This proposal reached stage…
🤬1
2ality – JavaScript and more
Template literal types in TypeScript: parsing during type checking and more
Template literal types in TypeScript: parsing during type checking and more
2Ality
Template literal types in TypeScript: parsing during type checking and more
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: Static syntax checking for string literals Transforming…
🤬1
2ality – JavaScript and more
Computing with tuples in TypeScript
Computing with tuples in TypeScript
2Ality
Computing with tuple types in TypeScript
JavaScript’s Arrays are so flexible that TypeScript provides two different kinds of types for handling them: Array types for arbitrary-length sequences of values that all have the same type – e.g.: Array<string> Tuple types for fixed-length sequences of values…
🤬1
TypeScript
Announcing TypeScript 5.8 Beta
Announcing TypeScript 5.8 Beta
Microsoft News
Announcing TypeScript 5.8 Beta
Today we are excited to announce the availability of TypeScript 5.8 Beta. To get started using the beta, you can get it through npm with the following command: npm install -D typescript@beta Let’s take a look at what’s new in TypeScript 5.8! Checked Returns…
🤩2🤬1
2ality – JavaScript and more
Tutorial: publishing ESM-based npm packages with TypeScript
Tutorial: publishing ESM-based npm packages with TypeScript
2Ality
Tutorial: publishing ESM-based npm packages with TypeScript
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:
👍1🤬1