Title: Feedback: 5.0 deprecations · Issue #51909 · microsoft/TypeScript · GitHub
Open Graph Title: Feedback: 5.0 deprecations · Issue #51909 · microsoft/TypeScript
X Title: Feedback: 5.0 deprecations · Issue #51909 · microsoft/TypeScript
Description: See also #51000 / #51424 In 5.0, we've marked the following configurations as deprecated: target: ES3 importsNotUsedAsValues noImplicitUseStrict keyofStringsOnly preserveValueImports suppressExcessPropertyErrors suppressImplicitAnyIndexE...
Open Graph Description: See also #51000 / #51424 In 5.0, we've marked the following configurations as deprecated: target: ES3 importsNotUsedAsValues noImplicitUseStrict keyofStringsOnly preserveValueImports suppressExcess...
X Description: See also #51000 / #51424 In 5.0, we've marked the following configurations as deprecated: target: ES3 importsNotUsedAsValues noImplicitUseStrict keyofStringsOnly preserveValueImports suppressEx...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/51909
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Feedback: 5.0 deprecations","articleBody":"See also #51000 / #51424\r\n\r\nIn 5.0, we've marked the following configurations as deprecated:\r\n * `target: ES3`\r\n * `importsNotUsedAsValues`\r\n * `noImplicitUseStrict`\r\n * `keyofStringsOnly`\r\n * `preserveValueImports`\r\n * `suppressExcessPropertyErrors`\r\n * `suppressImplicitAnyIndexErrors`\r\n * `noStrictGenericChecks`\r\n * `charset`\r\n * `out`\r\n * `prepend` in project references\r\n * implicitly OS-specific `newLine`\r\n\r\nThese configurations will continue to \"work\" until TypeScript 5.5, at which point they will be removed entirely. In TypeScript 4.9.5+, 5.0, 5.1, 5.2, 5.3, and 5.4, you can specify `ignoreDeprecations: \"5.0\"` to silence this warning.\r\n\r\n### What should I use instead?\r\n\r\n#### `target: ES3`\r\n\r\nES3 runtimes are nearly 100% extinct, so we're removing support for this as an emit target.\r\n\r\nFix: Use `target: ES5` as the next-closest thing along with a linter to detect any potentially-problematic ES3 constructs, or use `target: ESNext` and use a different downleveling emitter.\r\n\r\n#### `noImplicitUseStrict`\r\n\r\nThis flag disables emitting a `\"use strict\";` prologue at the top of module bodies when the target is not implicitly a module. This can lead to unexpected behavior since there are subtle behavioral differences between strict and nonstrict mode.\r\n\r\nFix: Remove any reliance on nonstrict behavior.\r\n\r\n#### `keyofStringsOnly`\r\n\r\nThis flag removes `symbol`-based keys from the `keyof T` type operator. This can lead to unexpected type errors when code relying on this flag interacts with code that doesn't.\r\n\r\nFix: Use `string \u0026 keyof T` to filter keys to those with `string` types.\r\n\r\n#### `suppressExcessPropertyErrors`\r\n\r\nThis flag disables excess property checking. This can lead to unexpected program behavior when an optional property name is misspelled, since no error is issued.\r\n\r\nFix: use a type assertion to silence this in cases where you really do want an optional property, or fix the target type.\r\n\r\n#### `suppressImplicitAnyIndexErrors`\r\n\r\nThis flag disables the error produced when indexing an object which doesn't support indexing. This was always intended to be a temporary flag, so is going away.\r\n\r\nFix: Add an index signature to the relevant type (or use a type assertion at the indexing location).\r\n\r\n#### `noStrictGenericChecks`\r\n\r\nThis flag disables certain checks relating the constraints of generic types, which can lead to undesirable unsound behavior.\r\n\r\nFix: Correct the types, or use a type assertion.\r\n\r\n#### `charset`\r\n\r\nThis flag hasn't done anything for a very long time.\r\n\r\nFix: Remove it from your config file\r\n\r\n#### `out`\r\n\r\nThis flag for emitting a single file from a set of nonmodule inputs incorrectly relied on the current working directory to compute the output filename, leading to unexpected problems when `tsc` was invoked programmatically or from a different directory.\r\n\r\nFix: use `outFile` instead.\r\n\r\n#### `prepend` in project references\r\n\r\nThis setting allowed for upstream project reference outputs to be prepended to the current project's output files. Had we not needed this ourselves back in 3.0, we likely wouldn't have added it in the first place, and it hasn't seen wide adoption.\r\n\r\nFix: Use a single tsconfig to create output bundles, or use an external bundler on the outputs.\r\n\r\n#### Implicitly OS-specific `newLine`\r\n\r\nThe `newLine` setting controls the line endings used in emitted files. If not specified, in TypeScript 4.9, this would default to the operating system's idiomatic newline (CR LF for Windows, LF for everyone else). Since all modern dev tools support LF endings without issue, we're removing this behavior to increase build predictability, and the new default is LF.\r\n\r\nFix: Pick one or the other, or use a tool after-the-fact to change outputs to the current OS's if this is really desired\r\n\r\n### Feedback?\r\n\r\nWe believe we've picked a fairly conservative set of options to deprecate in this release. If these deprecations are overly burdensome for your codebase, we'd like to understand why - please let us know!\r\n\r\nSearch terms: Flag is deprecated and will stop functioning in TypeScript 5.5. Specify ignoreDeprecations: 5.0 to silence this error","author":{"url":"https://github.com/RyanCavanaugh","@type":"Person","name":"RyanCavanaugh"},"datePublished":"2022-12-15T19:27:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":35},"url":"https://github.com/51909/TypeScript/issues/51909"}
| 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:7649fb66-78ec-3f41-5b2e-5d94b5c78ea3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DC0E:240318:37FBD8:4EC260:6A63061F |
| html-safe-nonce | ec50785e040d060394391fd55f2c34b2437f7f4e354aa9f3756dbe84ede12155 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzBFOjI0MDMxODozN0ZCRDg6NEVDMjYwOjZBNjMwNjFGIiwidmlzaXRvcl9pZCI6IjcxMjc5MTcyODA4NjYwMTA2NTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3726ef17a021053dc420c86b3876c8bbde13326e1318c21a034d9d39021e5598 |
| hovercard-subject-tag | issue:1498969440 |
| 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/51909/issue_layout |
| twitter:image | https://opengraph.githubassets.com/81f29570bd9b3c81c05efea9442b152cc831c65cbb19b2dd8a8bc43769390c5e/microsoft/TypeScript/issues/51909 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/81f29570bd9b3c81c05efea9442b152cc831c65cbb19b2dd8a8bc43769390c5e/microsoft/TypeScript/issues/51909 |
| og:image:alt | See also #51000 / #51424 In 5.0, we've marked the following configurations as deprecated: target: ES3 importsNotUsedAsValues noImplicitUseStrict keyofStringsOnly preserveValueImports suppressExcess... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RyanCavanaugh |
| hostname | github.com |
| expected-hostname | github.com |
| None | b48e7bf0b1945d51f303503b057abf666ce74c3efbe107b413db2bb921c3f012 |
| 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 | 9370f37042c29822d6ba7e3f670f0036a0155b21 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width