Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript types omit target "esnext" #6904

Closed
cspotcode opened this issue Feb 5, 2023 · 1 comment · Fixed by #6908
Closed

TypeScript types omit target "esnext" #6904

cspotcode opened this issue Feb 5, 2023 · 1 comment · Fixed by #6908
Labels
Milestone

Comments

@cspotcode
Copy link
Contributor

Describe the bug

In the same vein as #1746, #2633, and #4100

The type declarations omit "esnext"

swc/node-swc/src/types.ts

Lines 676 to 686 in c223113

export type JscTarget =
| "es3"
| "es5"
| "es2015"
| "es2016"
| "es2017"
| "es2018"
| "es2019"
| "es2020"
| "es2021"
| "es2022";

However, it is supported by swc:
https://play.swc.rs/?version=1.3.32&code=H4sIAAAAAAAAA8vMLcgvKlFIy89XsFUoSi0szSxK1VAHctU1rXm5kvPziktgwkAFhkbGQNFEXi5errT8Ig2IdKJCfppCfklGapGmQjUvlwIQ8HLVAgAbqPJ%2FWQAAAA%3D%3D&config=H4sIAAAAAAAAA0WNOw6EMAxE7%2BKaegvuwCGirEFZ5SePkYii3J0EZUVnzzw%2FV%2FrB0lopGwHLmFCimotW0pIZVlxWWkjRo914cOuLkYO1I4zI16h9SuAJLBRcdHsZMptCFgbeysTD%2F8nWXSF9zxHU59%2Fj%2FFB7HfPOYZugysntBp32lHq4AAAA

I also double-checked that swc logs it as a valid option in this error message:

Error: unknown variant `intentionally-wrong-to-get-error`, expected one of `es3`, `es5`, `es2015`, `es2016`, `es2017`, `es2018`, `es2019`, `es2020`, `es2021`, `es2022`, `esnext`

Input code

No response

Config

No response

Playground link

https://play.swc.rs/?version=1.3.32&code=H4sIAAAAAAAAA8vMLcgvKlFIy89XsFUoSi0szSxK1VAHctU1rXm5kvPziktgwkAFhkbGQNFEXi5errT8Ig2IdKJCfppCfklGapGmQjUvlwIQ8HLVAgAbqPJ%2FWQAAAA%3D%3D&config=H4sIAAAAAAAAA0WNOw6EMAxE7%2BKaegvuwCGirEFZ5SePkYii3J0EZUVnzzw%2FV%2FrB0lopGwHLmFCimotW0pIZVlxWWkjRo914cOuLkYO1I4zI16h9SuAJLBRcdHsZMptCFgbeysTD%2F8nWXSF9zxHU59%2Fj%2FFB7HfPOYZugysntBp32lHq4AAAA

Expected behavior

TypeScript types declare "esnext" as a valid JscTarget value.

Actual behavior

No response

Version

1.3.32

Additional context

No response

@cspotcode cspotcode added the C-bug label Feb 5, 2023
@kdy1 kdy1 added this to the Planned milestone Feb 5, 2023
@kdy1 kdy1 closed this as completed in #6908 Feb 7, 2023
kdy1 pushed a commit that referenced this issue Feb 7, 2023
@kdy1 kdy1 modified the milestones: Planned, v1.3.33, v1.3.34 Feb 8, 2023
@swc-bot
Copy link
Collaborator

swc-bot commented Mar 10, 2023

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Mar 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

3 participants