Title: Increase default tsc --init target over time · Issue #49206 · microsoft/TypeScript · GitHub
Open Graph Title: Increase default tsc --init target over time · Issue #49206 · microsoft/TypeScript
X Title: Increase default tsc --init target over time · Issue #49206 · microsoft/TypeScript
Description: Suggestion 🔍 Search Terms increase tsc init target es2016 default ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change the runtime beha...
Open Graph Description: Suggestion 🔍 Search Terms increase tsc init target es2016 default ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaScript co...
X Description: Suggestion 🔍 Search Terms increase tsc init target es2016 default ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaScrip...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/49206
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Increase default tsc --init target over time","articleBody":"# Suggestion\r\n\r\n## 🔍 Search Terms\r\n\r\nincrease tsc init target es2016 default\r\n\r\n## ✅ Viability Checklist\r\n\r\nMy suggestion meets these guidelines:\r\n\r\n* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code\r\n* [x] This wouldn't change the runtime behavior of existing JavaScript code\r\n* [x] This could be implemented without emitting different JS based on the types of the expressions\r\n* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)\r\n* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).\r\n\r\n## ⭐ Suggestion\r\n\r\nAs of 2022, all releases within the last year of browsers serving \u003e0.1% of worldwide users support at least all of ECMAScript 2019 and nearly all of ECMAScript 2020-2021, while the LTS-supported versions of Node.js support all of ECMAScript 2021. There's very little reason not to have a target at least as high as `\"es2019\"`.\r\n\r\nHow about increasing the default `tsc --init` value for `target` in later TypeScript versions over time to match the highest ECMAScript version supported by all LTS Node versions? That'd be `\"es2021\"` today.\r\n\r\n## 📃 Motivating Example\r\n\r\nHigher targets by default for consumers running `tsc --init` means they'll be able to use more language features as `String.replaceAll` by default. It's confusing to `tsc --init`, then not be able to use them.\r\n\r\n## 💻 Use Cases\r\n\r\nIncreasing default targets to emit code much cleaner in modern runtimes gives a nicer default output for new TypeScript projects. For beginners to TypeScript in particular, it makes the learning curve a little easier as they won't have to mess with configuration options to be able to use basic features.\r\n\r\nThis issue is thematically similar to but not the same as #47572 and #47573. Those issue are about changing the default compiler options when no value is specified on the CLI or in a TSConfig file. This issue is about changing the target specified when using `tsc --init`.","author":{"url":"https://github.com/JoshuaKGoldberg","@type":"Person","name":"JoshuaKGoldberg"},"datePublished":"2022-05-22T17:36:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/49206/TypeScript/issues/49206"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b593878b-1f6b-3a3e-bc68-05018bf6791e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BDE2:2D618B:980DEC:CDB110:6A4D4C01 |
| html-safe-nonce | 3ff3f9a294aa90ed49b6b5ba73815a24fc2596ca32397feb05bcec7741bcabad |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCREUyOjJENjE4Qjo5ODBERUM6Q0RCMTEwOjZBNEQ0QzAxIiwidmlzaXRvcl9pZCI6IjE0NDM4MDMzNTkxMjczNTg0NjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 947e668d1eec2366bf59cc0f580da08f85785c5a4a68b7c1ac07dec9353a4bff |
| hovercard-subject-tag | issue:1244319740 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/49206/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9f91bf1acb417b10b5d03f4522782ba32d13b47f8a074bf6165a5301e3a49d26/microsoft/TypeScript/issues/49206 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9f91bf1acb417b10b5d03f4522782ba32d13b47f8a074bf6165a5301e3a49d26/microsoft/TypeScript/issues/49206 |
| og:image:alt | Suggestion 🔍 Search Terms increase tsc init target es2016 default ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaScript co... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JoshuaKGoldberg |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width