target (compiler option)

The compiler option that chooses which ECMAScript edition the emitted JavaScript uses, such as ES2022.

In more detail

Newer syntax is kept as is when the target supports it; for an older target, tsc rewrites it into older code, sometimes with helper functions. TypeScript 6.0 deprecated the ES5 target and defaults to the newest edition, currently ES2025. Pick the oldest edition your runtime supports.

Example

tsc --target ES2022 app.ts

Related terms

Taught in

References