Title: The error for allowImportingTsExtensions does not reference rewriteRelativeImportExtensions · Issue #60397 · microsoft/TypeScript · GitHub
Open Graph Title: The error for allowImportingTsExtensions does not reference rewriteRelativeImportExtensions · Issue #60397 · microsoft/TypeScript
X Title: The error for allowImportingTsExtensions does not reference rewriteRelativeImportExtensions · Issue #60397 · microsoft/TypeScript
Description: 🔎 Search Terms error TS5096 allowImportingTsExtensions rewriteRelativeImportExtensions tsconfig diagnostics intellisense 🕗 Version & Regression Information This changed between versions N/A and 5.7.0-beta This changed in commit or PR #59...
Open Graph Description: 🔎 Search Terms error TS5096 allowImportingTsExtensions rewriteRelativeImportExtensions tsconfig diagnostics intellisense 🕗 Version & Regression Information This changed between versions N/A and 5.7...
X Description: 🔎 Search Terms error TS5096 allowImportingTsExtensions rewriteRelativeImportExtensions tsconfig diagnostics intellisense 🕗 Version & Regression Information This changed between versions N/A and...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/60397
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The error for allowImportingTsExtensions does not reference rewriteRelativeImportExtensions","articleBody":"### 🔎 Search Terms\n\n- error TS5096\n- allowImportingTsExtensions\n- rewriteRelativeImportExtensions\n- tsconfig\n- diagnostics\n- intellisense\n\n### 🕗 Version & Regression Information\n\n- This changed between versions N/A and 5.7.0-beta\n- This changed in commit or PR https://github.com/microsoft/TypeScript/pull/59767\n- This is the behavior in every version I tried, and I reviewed the FAQ for entries for `allowImportingTsExtensions` and `rewriteRelativeImportExtensions`\n- I was unable to test this on prior versions because it was only introduced in 5.7\n\n\n### ⏯ Playground Link\n\n_No response_\n\n### 💻 Code\n\ntsconfig.json with diagnostic error:\n\n```json\n{\n \"compilerOptions\": {\n \"module\": \"Node16\",\n \"moduleResolution\": \"Node16\",\n \"allowImportingTsExtensions\": true,\n }\n}\n```\n\n### 🙁 Actual behavior\n\nWhen specifying `allowImportingTsExtensions` as above, I get an error, as intended:\n\n```\ntsconfig.json:5:35 - error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n``` \n\nHowever, if I add `\"rewriteRelativeImportExtensions\": true` to the same tsconfig, the error goes away, which is contrary to the error message.\n\nThe _behavior_ seems correct, but the error message seems incomplete or inconsistent.\n\n---\n\nAt the same time, intellisense for `allowImportingTsExtensions` in VSCode reports:\n\n> Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set.\n\nThis is only mentioned as a requirement in intellisense, but not in the error message.\n\n### 🙂 Expected behavior\n\nI would expect the message to reference `rewriteRelativeImportExtensions` as one of the conditions that allow for `allowImportingTsExtensions`. \n\nI am not sure whether `--moduleResolution bundler` is required, but at least unifying the intellisense and diagnostic would be good. \n\nThe combination of factors seems to be \"`noEmit` or `emitDeclarationOnly` or `rewriteRelativeImportExtensions`\", but I am not sure what the exact new diagnostic message should be 😅\n\n(I don't mean to be nitpicky! I tend to learn best from intellisense and the diagnostics errors, so I was on the lookout for them when trying out the `5.7.0-beta` and `rewriteRelativeImportExtensions` 😌)\n\n### Additional information about the issue\n\n_No response_","author":{"url":"https://github.com/fpapado","@type":"Person","name":"fpapado"},"datePublished":"2024-11-03T18:14:08Z","url":"https://github.com/microsoft/TypeScript/issues/60397"}
| 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:f512cc66-4ba1-eab3-ab15-47f92f9957c5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A84E:2652DC:132F8DE:1894565:6B01120B |
| html-safe-nonce | ad9f4cfb26c98061d30e202c1f3d9540ca5a68c6ac193f045405fb203e76735d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODRFOjI2NTJEQzoxMzJGOERFOjE4OTQ1NjU6NkIwMTEyMEIiLCJ2aXNpdG9yX2lkIjoiNzAxNTU0NzYwMzgxMTc0MjgzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 08a14441b041eaded42a17b6db37aa4881bfc37c8d58f4099f90da94a0cc1c7c |
| hovercard-subject-tag | issue:2631372790 |
| 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/60397/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6709dd49ffcfe40197ef63bcd6e4bb39428b68a678078b5b16a69ed2aa2cbc02/microsoft/TypeScript/issues/60397 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6709dd49ffcfe40197ef63bcd6e4bb39428b68a678078b5b16a69ed2aa2cbc02/microsoft/TypeScript/issues/60397 |
| og:image:alt | 🔎 Search Terms error TS5096 allowImportingTsExtensions rewriteRelativeImportExtensions tsconfig diagnostics intellisense 🕗 Version & Regression Information This changed between versions N/A and 5.7... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fpapado |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width