2ality – JavaScript and more
ECMAScript feature: import attributes
ECMAScript feature: import attributes
2Ality
ECMAScript feature: import attributes
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.…
🤬1
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