Title: should allow use `export = ` in `.cts` when module is esnext · Issue #51018 · microsoft/TypeScript · GitHub
Open Graph Title: should allow use `export = ` in `.cts` when module is esnext · Issue #51018 · microsoft/TypeScript
X Title: should allow use `export = ` in `.cts` when module is esnext · Issue #51018 · microsoft/TypeScript
Description: Bug Report 🔎 Search Terms 🕗 Version & Regression Information This is a crash This changed between versions ______ and _______ This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________ I was unable ...
Open Graph Description: Bug Report 🔎 Search Terms 🕗 Version & Regression Information This is a crash This changed between versions ______ and _______ This is the behavior in every version I tried, and I reviewed the FAQ f...
X Description: Bug Report 🔎 Search Terms 🕗 Version & Regression Information This is a crash This changed between versions ______ and _______ This is the behavior in every version I tried, and I reviewed the F...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/51018
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"should allow use `export = ` in `.cts` when module is esnext","articleBody":"# Bug Report\r\n\r\n\u003c!--\r\n Please fill in each section completely. Thank you!\r\n--\u003e\r\n\r\n### 🔎 Search Terms\r\n\r\n\u003c!--\r\n What search terms did you use when trying to find an existing bug report?\r\n List them here so people in the future can find this one more easily.\r\n--\u003e\r\n\r\n### 🕗 Version \u0026 Regression Information\r\n\r\n\u003c!-- When did you start seeing this bug occur?\r\n\r\n\"Bugs\" that have existed in TS for a long time are very likely to be FAQs; refer to\r\n https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs\r\n\r\nIf possible, please try testing the nightly version of TS to see if it's already been fixed.\r\nFor npm: `typescript@next`\r\nThis is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly\r\n\r\nNote: The TypeScript Playground can be used to try older versions of TypeScript.\r\n\r\nPlease keep and fill in the line that best applies:\r\n--\u003e\r\n- This is a crash\r\n- This changed between versions ______ and _______\r\n- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________\r\n- I was unable to test this on prior versions because _______\r\n\r\n### ⏯ Playground Link\r\n\r\n\u003c!--\r\n A link to a TypeScript Playground \"Share\" link which shows this behavior\r\n\r\n The TypeScript Workbench can be used for more complex setups, try\r\n https://www.typescriptlang.org/dev/bug-workbench/\r\n\r\n As a last resort, you can link to a repo, but these will be slower for us to investigate.\r\n--\u003e\r\n[Playground link with relevant code](https://www.typescriptlang.org/play?#code/PTAEFkE9QYwewCYFNQHM5IM6gBZIE5JA)\r\n\r\n### 💻 Code\r\n\r\nindex.cts\r\n\u003c!-- Please post the relevant code sample here as well--\u003e\r\n```ts\r\nimport { globToTree } from './index';\r\n\r\nexport = globToTree\r\n```\r\n\r\nindex.ts\r\n```ts\r\nexport function globToTree(): any {}\r\nObject.defineProperty(globToTree, \"__esModule\", { value: true });\r\nObject.defineProperty(globToTree, \"globToTree\", { value: globToTree });\r\nObject.defineProperty(globToTree, \"default\", { value: globToTree });\r\nexport default globToTree\r\n```\r\n\r\n```json\r\n{\r\n \"compilerOptions\": {\r\n \"module\": \"esnext\",\r\n \"target\": \"es2019\",\r\n \"jsx\": \"preserve\",\r\n \"moduleResolution\": \"node\",\r\n \"allowJs\": false,\r\n \"allowUmdGlobalAccess\": false,\r\n \"sourceMap\": true,\r\n \"inlineSourceMap\": false,\r\n \"inlineSources\": true,\r\n \"declaration\": false,\r\n \"experimentalDecorators\": true,\r\n \"emitDecoratorMetadata\": true,\r\n \"allowSyntheticDefaultImports\": true,\r\n \"resolveJsonModule\": true,\r\n \"strict\": true,\r\n \"strictBindCallApply\": true,\r\n \"strictNullChecks\": false,\r\n \"strictFunctionTypes\": true,\r\n \"noImplicitThis\": true,\r\n \"noImplicitOverride\": true,\r\n \"noUncheckedIndexedAccess\": true,\r\n \"noPropertyAccessFromIndexSignature\": true,\r\n \"preserveConstEnums\": true,\r\n \"forceConsistentCasingInFileNames\": true,\r\n \"incremental\": true,\r\n \"noErrorTruncation\": true,\r\n \"removeComments\": false,\r\n \"traceResolution\": false,\r\n \"newLine\": \"lf\",\r\n \"esModuleInterop\": true,\r\n \"importHelpers\": true,\r\n \"noFallthroughCasesInSwitch\": true,\r\n \"noUnusedLocals\": true,\r\n \"noUnusedParameters\": true,\r\n \"skipLibCheck\": true,\r\n \"noEmit\": true\r\n }\r\n}\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\n\u003c!-- What happened, and why it was wrong --\u003e\r\n\r\nshow error\r\n\r\n\r\n\r\nor use `@ts-ignore` avoid it\r\n\r\n```ts\r\nimport { globToTree } from './index';\r\n\r\n// @ts-ignore\r\nexport = globToTree\r\n```\r\n\r\n\r\n### 🙂 Expected behavior\r\n\r\n\u003c!-- What you expected to happen instead, and why --\u003e\r\n\r\nno need `@ts-ignore`\r\n","author":{"url":"https://github.com/bluelovers","@type":"Person","name":"bluelovers"},"datePublished":"2022-09-30T23:38:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/51018/TypeScript/issues/51018"}
| 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:a4fec2cf-6563-806d-0c9f-8639cb609361 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A370:1F68DB:4ED8868:68CD833:6A5DAD54 |
| html-safe-nonce | 1cfed4ab64f1d09d0f98c4794726e5d61dac922402e2804a0ff293776a0463ce |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzcwOjFGNjhEQjo0RUQ4ODY4OjY4Q0Q4MzM6NkE1REFENTQiLCJ2aXNpdG9yX2lkIjoiNjc1MTEyNjI0NjczMzQ5MTU0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8705f1feed872a5bdec5b43a269d15f3c19bbb9e8a1ffc9b6ec6bfc576cf30d2 |
| hovercard-subject-tag | issue:1393119893 |
| 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/51018/issue_layout |
| twitter:image | https://opengraph.githubassets.com/805aaba5a02e51ad5861515cc6d7e01a2c6fbee9a24698b0ef06169001861da4/microsoft/TypeScript/issues/51018 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/805aaba5a02e51ad5861515cc6d7e01a2c6fbee9a24698b0ef06169001861da4/microsoft/TypeScript/issues/51018 |
| og:image:alt | Bug Report 🔎 Search Terms 🕗 Version & Regression Information This is a crash This changed between versions ______ and _______ This is the behavior in every version I tried, and I reviewed the FAQ f... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bluelovers |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width