Skip to content

Commit

Permalink
fix #4004: support es2024 in tsconfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Dec 19, 2024
1 parent 9eca464 commit b804d31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

* Allow `es2024` as a target in `tsconfig.json` ([#4004](https://github.com/evanw/esbuild/issues/4004))

TypeScript recently [added `es2024`](https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/#support-for---target-es2024-and---lib-es2024) as a compilation target, so esbuild now supports this in the `target` field of `tsconfig.json` files. As a reminder, the only thing that esbuild uses this field for is determining whether or not to use legacy TypeScript behavior for class fields (you can read more in [the documentation](https://esbuild.github.io/content-types/#tsconfig-json)).

* Allow automatic semicolon insertion after `get`/`set`

This change fixes a grammar bug in the parser that incorrectly treated the following code as a syntax error:
Expand Down
2 changes: 1 addition & 1 deletion internal/resolver/tsconfig_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func ParseTSConfigJSON(
switch lowerValue {
case "es3", "es5", "es6", "es2015", "es2016", "es2017", "es2018", "es2019", "es2020", "es2021":
result.Settings.Target = config.TSTargetBelowES2022
case "es2022", "es2023", "esnext":
case "es2022", "es2023", "es2024", "esnext":
result.Settings.Target = config.TSTargetAtOrAboveES2022
default:
ok = false
Expand Down

0 comments on commit b804d31

Please sign in to comment.