Closed chungweileong94 closed 5 months ago
A bit of context, I personally use a lot of non-tsc toolings like tsx
, bunchee
& etc, so I use "module": "preserve"
most of the time. I'm not sure if there are cases where we might not want to use "module": "preserve"
for non-tsc or typescript version below v5.
100% a mistake, and a bizarre one. Thanks for the issue, fixed in 1.0.3.
When I use the following tsconfig.json
, then VSCode provides .js
extensions for all file imports (path auto-completion), even if I have only .ts
files in my project:
{
"extends": "@total-typescript/tsconfig/bundler/no-dom"
}
I can get TypeScript imports back, when I change the tsconfig.json
to:
{
"extends": "@total-typescript/tsconfig/bundler/no-dom",
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler"
}
}
@kporten Could you provide a reproduction? Code looks fine to me.
Yes, here you can find the reproduction: https://github.com/kporten/reproduction-tsconfig-vscode/tree/main
In https://github.com/kporten/reproduction-tsconfig-vscode/blob/main/src/index.ts a note explains how to get the .js
auto-completions instead of the .ts
files.
@kporten Thanks, I also repeated your findings.
This seems like an upstream TypeScript issue to me. Appears that just having "module: preserve" isn't enough to fix these auto imports.
Raise something there and link this issue.
Was it a mistake or there is a reason why we are not using
"module": "preserve"
for bundler?References: