Conversation

saschanaz

Closes #44653

@typescript-bottypescript-bot added the For Uncommitted BugPR for untriaged, rejected, closed or missing buglabel Jun 18, 2021
@@ -184,7 +184,7 @@ namespace ts {
file: undefined,
start: 0,
length: 0,
messageText: "Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'esnext'.",
messageText: "Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext'.",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting to see this hasn't failed. I don't think this even runs 🤔

@saschanaz

Should this function return ModuleKind.ES2020 and ES2022 following the target version? It seems #33893 missed this, and I wonder this needs to be fixed.

export function getEmitModuleKind(compilerOptions: {module?: CompilerOptions["module"], target?: CompilerOptions["target"]}) {
return typeof compilerOptions.module === "number" ?
compilerOptions.module :
getEmitScriptTarget(compilerOptions) >= ScriptTarget.ES2015 ? ModuleKind.ES2015 : ModuleKind.CommonJS;
}

@typescript-bottypescript-bot removed the For Uncommitted BugPR for untriaged, rejected, closed or missing buglabel Jul 2, 2021
@typescript-bottypescript-bot added the For Backlog BugPRs that fix a backlog buglabel Jul 2, 2021
@ortaorta mentioned this pull request Sep 2, 2021
@MartinJohns

PR seems kind of outdated.

@saschanaz

I'll rebase once anyone reviews this (or a maintainer requests a rebase).

@weswigham

This is going to look a weeee bit different after a merge since the module: node changes touch many of the same lines, but initially it looks ok.

@simllll

Next to module: node12, this is another thing I'm really looking forward to. Currently there is no real setting for node 16 environment, see also https://.com/microsoft/TypeScript/wiki/Node-Target-Mapping

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This little looks fine to me - @DanielRosenwasser do we want this in for the beta?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this seems reasonable.

@standiki

What could be the default option for this and the highest version, I guess is none and esnext?

Sign up for free to join this conversation on . Already have an account? Sign in to comment
For Backlog BugPRs that fix a backlog bug
Archived in project

Successfully merging this pull request may close these issues.

Add module: es2022