mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-17 12:19:32 -05:00
Properly detect explicitly-set targets (#51834)
This commit is contained in:
@@ -522,7 +522,7 @@ export const targetOptionDeclaration: CommandLineOptionOfCustomType = {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Language_and_Environment,
|
||||
description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
|
||||
defaultValueDescription: ScriptTarget.ES3,
|
||||
defaultValueDescription: ScriptTarget.ES5,
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
|
||||
@@ -7515,10 +7515,10 @@ export function getSetExternalModuleIndicator(options: CompilerOptions): (file:
|
||||
|
||||
/** @internal */
|
||||
export function getEmitScriptTarget(compilerOptions: {module?: CompilerOptions["module"], target?: CompilerOptions["target"]}): ScriptTarget {
|
||||
return compilerOptions.target ||
|
||||
(compilerOptions.module === ModuleKind.Node16 && ScriptTarget.ES2022) ||
|
||||
return compilerOptions.target ??
|
||||
((compilerOptions.module === ModuleKind.Node16 && ScriptTarget.ES2022) ||
|
||||
(compilerOptions.module === ModuleKind.NodeNext && ScriptTarget.ESNext) ||
|
||||
ScriptTarget.ES5;
|
||||
ScriptTarget.ES5);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
|
||||
Reference in New Issue
Block a user