Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
.d.ts source map allowing go to def to jump to source directly #14479
I know it has been asked and discussed before, but I couldn't find an explanation why you recommend to export only the type definitions when publishing an npm package.
As a consumer of an npm package it is quite annoying to end up in d.ts files when browsing code. Especially because I have to switch to the generate, down-leveled JS code to read the actual implementation. It is not only much less readable but also no longer well supported by my editor (no types).
I understand that the tsconfig is important and that one doesn't want to recompile typescript code from npm packages, but the tools should really show the original source instead of the generated code.
I am working on a monorepo project with a bunch of local npm packages with references. We use synthetic links (learna) and in
Could you explain what problems this could cause and why you generally seem to recommend not to it like this?
This could solve a problem I'm currently facing. In our project we are using a stricter compilation options for Typescript, but some of the npm modules we use publish the Typescript source code, yet they are not as strict as we are. Which results in a compilation errors when we build our project.
Having a d.ts sourcemap will also provide a solution for people with big repository that they wish to continuously migrate to stricter Typescript - They could create sourcemap to old Typescript and compile only the d.ts, which skips strict checks, while having a base with stricter checks that they can continuously enlarge.