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

Update lib and target fields to a newer ES version #4

Open
yokuze opened this issue Jul 27, 2022 · 0 comments
Open

Update lib and target fields to a newer ES version #4

yokuze opened this issue Jul 27, 2022 · 0 comments
Assignees

Comments

@yokuze
Copy link
Contributor

yokuze commented Jul 27, 2022

Currently, the lib and target fields are pointing at es2019, but newer versions are available in the latest version of TypeScript.

I recommend setting lib to es2022 but target to es2021 since es2021 is fully supported in Node 16: https://node.green/#ES2021 but es2022 is not yet. Most of the differences between es2021 and es2022 are in supported syntax. By setting lib to es2022 but target to es2021, we can take advantage of newer syntax in our code, but TypeScript will transpile down to syntax compatible with es2021/Node 16.

It seems there aren't really any built-in methods/classes/etc added between es2019 and es2022 that would break us in a Node environment that does not use Babel, other than the Error.cause property: https://node.green/#ES2022-features-Error-cause-property

Note: After doing this, we should make sure that any repo that we integrate this into that also uses Babel is using the latest version of core-js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants