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

tsconfig: Use ESNext in target and lib #23

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Conversation

philbates35
Copy link
Owner

From what I can tell, the value of target doesn't actually matter, because we have noEmit set to true - its esbuild in dev (configured by Vite's esbuild.target) and Rollup for prod build (configured by build.target) that do the transpiling, but there's no harm in updating it anyway.

Setting lib to include ESNext allows us to use more modern features such as "promise.any, string.replaceAll etc" (ES2021) and "array.at, RegExp.hasIndices, etc." (ES2022).

Its also worth noting that these are the values of the tsconfig.json that come when using Laravel Breeze with one of its TS starters.

See:

From what I can tell, the value of target doesn't actually matter,
because we have noEmit set to true - its esbuild in dev (configured
by Vite's esbuild.target) and Rollup for prod build (configured by
build.target) that do the transpiling, but there's no harm in
updating it anyway.

Setting "lib" to include ESNext allows us to use more modern features
such as "promise.any, string.replaceAll etc" (ES2021) and
"array.at, RegExp.hasIndices, etc." (ES2022).

Its also worth noting that these are the values of the tsconfig.json
that come when using Laravel Breeze with one of its TS starters.

See:
* https://www.typescriptlang.org/tsconfig#lib
* https://www.typescriptlang.org/tsconfig#target
* https://github.com/laravel/breeze/blob/095c4c597c3719e2a596fcf4689288e9cdbc6520/stubs/inertia-react-ts/tsconfig.json
@philbates35 philbates35 merged commit 69fc6da into main Feb 15, 2024
11 checks passed
@philbates35 philbates35 deleted the tsconfig-esnext branch February 15, 2024 16:47
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

Successfully merging this pull request may close these issues.

1 participant