microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
100.95k stars 12.47k forks source link

dts resolve to CJS entry dts instead of ESM entry dts when not included in tsconfig #53958

Closed loynoir closed 1 year ago

loynoir commented 1 year ago

Bug Report

dts resolve to CJS entry dts instead of ESM entry dts when js not included in tsconfig

🔎 Search Terms

🕗 Version & Regression Information

⏯ Playground Link

Playground link with relevant code

💻 Code

await import('@sinclair/typebox')

https://github.com/loynoir/reproduce-typescript-53958

$ npm exec -- tsc --showConfig  | grep checkJs
        "checkJs": true
$ npm exec -- tsc --showConfig  | grep include -A 4
    "include": [
        "./src/**/*",
        "./test/**/*",
        "./reproduce2/**/*"
    ],

🙁 Actual behavior

dts resolve to ./node_modules/@sinclair/typebox/cjs/typebox.d.ts

🙂 Expected behavior

dts resolve to ./node_modules/@sinclair/typebox/esm/typebox.d.ts

RyanCavanaugh commented 1 year ago

The files in reproduce1 don't correspond to any tsconfig file, so nothing causes them to have moduleResolution: "nodenext" as is required to do node16 module resolution

microsoft-github-policy-service[bot] commented 1 year ago

This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

microsoft-github-policy-service[bot] commented 1 year ago

This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

microsoft-github-policy-service[bot] commented 1 year ago

This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

microsoft-github-policy-service[bot] commented 1 year ago

This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.