@@ -7277,6 +7277,9 @@ export const enum ScriptKind {
72777277 Deferred = 7 ,
72787278}
72797279
7280+ // NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in
7281+ // June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`,
7282+ // transformers/esnext.ts, commandLineParser.ts, and the contents of each lib/esnext.*.d.ts file.
72807283export const enum ScriptTarget {
72817284 /** @deprecated */
72827285 ES3 = 0 ,
@@ -8035,6 +8038,65 @@ export type UniqueNameHandler = (baseName: string, checkFn?: (name: string) => b
80358038
80368039export type EmitHelperUniqueNameCallback = ( name : string ) => string ;
80378040
8041+ /**
8042+ * Indicates the minimum `ScriptTarget` (inclusive) after which a specific language feature is no longer transpiled.
8043+ *
8044+ * @internal
8045+ */
8046+ export const enum LanguageFeatureMinimumTarget {
8047+ // ES2015 Features
8048+ Classes = ScriptTarget . ES2015 ,
8049+ ForOf = ScriptTarget . ES2015 ,
8050+ Generators = ScriptTarget . ES2015 ,
8051+ Iteration = ScriptTarget . ES2015 ,
8052+ SpreadElements = ScriptTarget . ES2015 ,
8053+ RestElements = ScriptTarget . ES2015 ,
8054+ TaggedTemplates = ScriptTarget . ES2015 ,
8055+ DestructuringAssignment = ScriptTarget . ES2015 ,
8056+ BindingPatterns = ScriptTarget . ES2015 ,
8057+ ArrowFunctions = ScriptTarget . ES2015 ,
8058+ BlockScopedVariables = ScriptTarget . ES2015 ,
8059+ ObjectAssign = ScriptTarget . ES2015 ,
8060+
8061+ // ES2016 Features
8062+ Exponentiation = ScriptTarget . ES2016 , // `x ** y`
8063+
8064+ // ES2017 Features
8065+ AsyncFunctions = ScriptTarget . ES2017 , // `async function f() {}`
8066+
8067+ // ES2018 Features
8068+ ForAwaitOf = ScriptTarget . ES2018 , // `for await (const x of y)`
8069+ AsyncGenerators = ScriptTarget . ES2018 , // `async function * f() { }`
8070+ AsyncIteration = ScriptTarget . ES2018 , // `Symbol.asyncIterator`
8071+ ObjectSpreadRest = ScriptTarget . ES2018 , // `{ ...obj }`
8072+
8073+ // ES2019 Features
8074+ BindinglessCatch = ScriptTarget . ES2019 , // `try { } catch { }`
8075+
8076+ // ES2020 Features
8077+ BigInt = ScriptTarget . ES2020 , // `0n`
8078+ NullishCoalesce = ScriptTarget . ES2020 , // `a ?? b`
8079+ OptionalChaining = ScriptTarget . ES2020 , // `a?.b`
8080+
8081+ // ES2021 Features
8082+ LogicalAssignment = ScriptTarget . ES2021 , // `a ||= b`, `a &&= b`, `a ??= b`
8083+
8084+ // ES2022 Features
8085+ TopLevelAwait = ScriptTarget . ES2022 ,
8086+ ClassFields = ScriptTarget . ES2022 ,
8087+ PrivateNamesAndClassStaticBlocks = ScriptTarget . ES2022 , // `class C { static {} #x = y, #m() {} }`, `#x in y`
8088+
8089+ // ES2023 Features
8090+ ShebangComments = ScriptTarget . ESNext ,
8091+
8092+ // Upcoming Features
8093+ // NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in
8094+ // June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`,
8095+ // transformers/esnext.ts, commandLineParser.ts, and the contents of each lib/esnext.*.d.ts file.
8096+ UsingAndAwaitUsing = ScriptTarget . ESNext , // `using x = y`, `await using x = y`
8097+ ClassAndClassElementDecorators = ScriptTarget . ESNext , // `@dec class C {}`, `class C { @dec m() {} }`
8098+ }
8099+
80388100// dprint-ignore
80398101/**
80408102 * Used by the checker, this enum keeps track of external emit helpers that should be type
0 commit comments