Skip to content

Add module: es2022#44656

Merged
DanielRosenwasser merged 1 commit into
microsoft:mainfrom
saschanaz:es2022
Sep 30, 2021
Merged

Add module: es2022#44656
DanielRosenwasser merged 1 commit into
microsoft:mainfrom
saschanaz:es2022

Conversation

@saschanaz

Copy link
Copy Markdown
Contributor

Closes #44653

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jun 18, 2021
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
Copy Markdown
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

saschanaz commented Jun 18, 2021

Copy link
Copy Markdown
Contributor Author

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

PR seems kind of outdated.

@saschanaz

saschanaz commented Sep 25, 2021

Copy link
Copy Markdown
Contributor Author

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

@weswigham

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

simllll commented Sep 28, 2021

Copy link
Copy Markdown
Contributor

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

@weswigham weswigham left a comment

Copy link
Copy Markdown
Member

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?

@DanielRosenwasser DanielRosenwasser left a comment

Copy link
Copy Markdown
Member

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

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

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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

8 participants