You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When specifying allowImportingTsExtensions as above, I get an error, as intended:
tsconfig.json:5:35 - error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.
However, if I add "rewriteRelativeImportExtensions": true to the same tsconfig, the error goes away, which is contrary to the error message.
The behavior seems correct, but the error message seems incomplete or inconsistent.
At the same time, intellisense for allowImportingTsExtensions in VSCode reports:
Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set.
This is only mentioned as a requirement in intellisense, but not in the error message.
🙂 Expected behavior
I would expect the message to reference rewriteRelativeImportExtensions as one of the conditions that allow for allowImportingTsExtensions.
I am not sure whether --moduleResolution bundler is required, but at least unifying the intellisense and diagnostic would be good.
The combination of factors seems to be "noEmit or emitDeclarationOnly or rewriteRelativeImportExtensions", but I am not sure what the exact new diagnostic message should be 😅
(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 😌)
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered:
fpapado
changed the title
The warning for allowImportingTsExtensions is inconsistent with rewriteRelativeImportExtensions
The error for allowImportingTsExtensions does not reference rewriteRelativeImportExtensions
Nov 3, 2024
I couldn't find a working configuration for using rewriteRelativeImportExtensions and allowImportingTsExtensions together. I want tsc to emit, and rewrite .ts to .js. But the LSP errors on me when I add allowImportingTsExtensions: true to my tsconfig. Also rewriteRelativeImportExtensions isn't allowed in tsconfig, which doesn't make sense.
Edit: My bad. rewriteRelativeImportExtensions is allowed in tsconfig. VSCode was using 5.6 and it confused me.
🔎 Search Terms
🕗 Version & Regression Information
allowImportingTsExtensions
andrewriteRelativeImportExtensions
⏯ Playground Link
No response
💻 Code
tsconfig.json with diagnostic error:
🙁 Actual behavior
When specifying
allowImportingTsExtensions
as above, I get an error, as intended:However, if I add
"rewriteRelativeImportExtensions": true
to the same tsconfig, the error goes away, which is contrary to the error message.The behavior seems correct, but the error message seems incomplete or inconsistent.
At the same time, intellisense for
allowImportingTsExtensions
in VSCode reports:This is only mentioned as a requirement in intellisense, but not in the error message.
🙂 Expected behavior
I would expect the message to reference
rewriteRelativeImportExtensions
as one of the conditions that allow forallowImportingTsExtensions
.I am not sure whether
--moduleResolution bundler
is required, but at least unifying the intellisense and diagnostic would be good.The combination of factors seems to be "
noEmit
oremitDeclarationOnly
orrewriteRelativeImportExtensions
", but I am not sure what the exact new diagnostic message should be 😅(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
andrewriteRelativeImportExtensions
😌)Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: