Skip to content

Conversation

saschanaz
Copy link
Contributor

Closes #44653

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label 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
Copy link
Contributor Author

saschanaz commented Jun 18, 2021

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-bot typescript-bot removed the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jul 2, 2021
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Jul 2, 2021
@orta orta mentioned this pull request Sep 2, 2021
@MartinJohns
Copy link
Contributor

PR seems kind of outdated.

@saschanaz
Copy link
Contributor Author

saschanaz commented Sep 25, 2021

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

@weswigham
Copy link
Member

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
Copy link
Contributor

simllll commented Sep 28, 2021

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://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping

Copy link
Member

@weswigham weswigham left a comment

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?

Copy link
Member

@DanielRosenwasser DanielRosenwasser left a comment

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
Copy link

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 GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add module: es2022
7 participants