Auto import with .js
extension instead of .ts
with "allowImportingTsExtensions": true
and package.json
, imports fields
#59553
Labels
Fix Available
A PR has been opened for this issue
Needs Investigation
This issue needs a team member to investigate its status.
Milestone
π Search Terms
"auto imports", "allowImportingTsExtensions", "package.json imports", ".js extension instead of .ts", "moduleResolution": "NodeNext"
π Version & Regression Information
TypeScript v5.5.4
β― Playground Link
No response
π» Code
tsconfig.json
:package.json
:src/lib/add.ts
(not really important, the content of the file, path is more important):src/index.ts
:π Actual behavior
Auto import with
#lib/add.js"
π Expected behavior
Auto import with
#lib/add.ts"
because I'm using the"allowImportingTsExtensions": true
config option.This is all the more relevant since the newly added CLI Flag
--experimental-strip-types
in Node.js, because it enforces imports to use the.ts
extension.Ref: https://nodejs.org/docs/latest/api/typescript.html
Additional information about the issue
Related issue: #52167
The text was updated successfully, but these errors were encountered: