Title: `module.exports.property` results in a property of type any · Issue #25621 · microsoft/TypeScript · GitHub
Open Graph Title: `module.exports.property` results in a property of type any · Issue #25621 · microsoft/TypeScript
X Title: `module.exports.property` results in a property of type any · Issue #25621 · microsoft/TypeScript
Description: module.exports.y = "hi" let u = module.exports.y/**/ Get quick info at position. Expected behavior: The type of module.exports.y is reported as string. Actual behavior: The type of module.exports.y is reported as any, and there aren't an...
Open Graph Description: module.exports.y = "hi" let u = module.exports.y/**/ Get quick info at position. Expected behavior: The type of module.exports.y is reported as string. Actual behavior: The type of module.exports.y...
X Description: module.exports.y = "hi" let u = module.exports.y/**/ Get quick info at position. Expected behavior: The type of module.exports.y is reported as string. Actual behavior: The type of module...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/25621
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`module.exports.property` results in a property of type any","articleBody":"```js\r\nmodule.exports.y = \"hi\"\r\nlet u = module.exports.y/**/\r\n```\r\n\r\nGet quick info at position.\r\n\r\n**Expected behavior:**\r\n\r\nThe type of `module.exports.y` is reported as string.\r\n\r\n**Actual behavior:**\r\n\r\nThe type of `module.exports.y` is reported as any, and there aren't any completions, so it seems like it actually is any.\r\n\r\nEdit:\r\n1. Repros on 2.9.2 and master.\r\n2. When imported, the type is correct\r\n\r\n```js\r\nvar { y } = require('./mod')\r\ny/**/\r\n```\r\n\r\nThe declared type is used if there is one, even if it contradicts the initialiser (eg `/** @type {number} */ module.exports.y = 'hi'`).","author":{"url":"https://github.com/sandersn","@type":"Person","name":"sandersn"},"datePublished":"2018-07-12T23:29:28Z","url":"https://github.com/microsoft/TypeScript/issues/25621"}
| 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:d97cc0b2-b53f-483a-fc24-5f3a619c1f2c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D006:2F9718:217D403:2CEE149:6B0194F7 |
| html-safe-nonce | 156eae14271e4f795bfde037f55b3fce649d1b29686b479fd73c99d625f8e753 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDA2OjJGOTcxODoyMTdENDAzOjJDRUUxNDk6NkIwMTk0RjciLCJ2aXNpdG9yX2lkIjoiMzIxNTU3ODMyMTk0NTQ2NjEwMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4fba053d72567ea0c2ad721cd41e74fad7796cbfa0b2cdf8c479bfbcdc724c4b |
| hovercard-subject-tag | issue:340832178 |
| 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/25621/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f987629ef301e346282c9bbede4a8f6595023b83e911a77c8fe511730fa3af02/microsoft/TypeScript/issues/25621 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f987629ef301e346282c9bbede4a8f6595023b83e911a77c8fe511730fa3af02/microsoft/TypeScript/issues/25621 |
| og:image:alt | module.exports.y = "hi" let u = module.exports.y/**/ Get quick info at position. Expected behavior: The type of module.exports.y is reported as string. Actual behavior: The type of module.exports.y... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sandersn |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width