Lesson

Use the erasableSyntaxOnly TypeScript compilation flag

TypeScript v5.8 ships with the new erasableSyntaxOnly compiler flag, which disallows using TypeScript enums, class property accessors and namespaces.

Access
Pro
Transcript
Available

TypeScript v5.8 ships with the new erasableSyntaxOnly compiler flag.

It disallows using the TS features which emit additional JavaScript output, due to being outside of official ECMAScript specification.

In this lesson we'll see what TypeScript features get affected and why exactly.

Check out the playground link with the code.