Title: Add a refactoring that annotates an implicit or explicit any with a best guess type inferred from its use sites · Issue #13243 · microsoft/TypeScript · GitHub
Open Graph Title: Add a refactoring that annotates an implicit or explicit any with a best guess type inferred from its use sites · Issue #13243 · microsoft/TypeScript
X Title: Add a refactoring that annotates an implicit or explicit any with a best guess type inferred from its use sites · Issue #13243 · microsoft/TypeScript
Description: I would very much appreciate having a codefix (refactoring) that, given an explicit any annotation, offers to change it to an {} annotation. For example, given function log(x: any) { console.log(x); } a code fix would be offered to chang...
Open Graph Description: I would very much appreciate having a codefix (refactoring) that, given an explicit any annotation, offers to change it to an {} annotation. For example, given function log(x: any) { console.log(x)...
X Description: I would very much appreciate having a codefix (refactoring) that, given an explicit any annotation, offers to change it to an {} annotation. For example, given function log(x: any) { console.log(x)...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/13243
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add a refactoring that annotates an implicit or explicit any with a best guess type inferred from its use sites","articleBody":"I would very much appreciate having a codefix (refactoring) that, given an explicit `any` annotation, offers to change it to an `{}` annotation.\r\n\r\nFor example, given\r\n```ts\r\nfunction log(x: any) {\r\n console.log(x);\r\n}\r\n```\r\na code fix would be offered to change the declared type of `x` to `{}` resulting in\r\n```ts\r\nfunction log(x: {}) {\r\n console.log(x);\r\n}\r\n```\r\n\r\nHowever, given\r\n```ts\r\nfunction log(x: any) {\r\n console.log(x.name);\r\n}\r\n```\r\na code fix would be offered to change the declared type of `x` to `{ name: any }` resulting in\r\n```ts\r\nfunction log(x: {name: any}) {\r\n console.log(x);\r\n}\r\n```","author":{"url":"https://github.com/aluanhaddad","@type":"Person","name":"aluanhaddad"},"datePublished":"2017-01-01T18:37:43Z","url":"https://github.com/microsoft/TypeScript/issues/13243"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:69c38aba-7668-13c4-9651-0809d959b67f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 96B4:317608:AE91B0:DEB24E:6B00F52A |
| html-safe-nonce | b2a26279828e0db271cb27a5cd7158bf068ec61ea637c5127783c7cb1a690545 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkI0OjMxNzYwODpBRTkxQjA6REVCMjRFOjZCMDBGNTJBIiwidmlzaXRvcl9pZCI6IjgwODc2OTc3MjY4Mzk1MTg1MDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3c728b937976e0e0d4348c0a5405c0ad85c29faffe28b279b319ccc9d8e0ecb2 |
| hovercard-subject-tag | issue:198276970 |
| 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/13243/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4cc734b13a4d664f649191655bf7725bed47c6e1ab14f41aa35259e6597a8bf4/microsoft/TypeScript/issues/13243 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4cc734b13a4d664f649191655bf7725bed47c6e1ab14f41aa35259e6597a8bf4/microsoft/TypeScript/issues/13243 |
| og:image:alt | I would very much appreciate having a codefix (refactoring) that, given an explicit any annotation, offers to change it to an {} annotation. For example, given function log(x: any) { console.log(x)... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aluanhaddad |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width