I'm not sure if this is in scope of Knip, but it feels like it could be. In a nutshell, if I have a module like this:
// bar/src/index.ts
import type { Foo } from "foo";
export const bar = (): Foo => ...
And foo comes with a corresponding @types/foo, then I need to make sure that it's actually in dependencies. Otherwise bar/dist/index.d.ts will be broken in any consumer of bar that doesn't have @types/foo in its dependency tree.
The complication I'm seeing is determining whether a @types/* actually ends up being used in dist. And putting all @types/* in dependencies doesn't make sense, obviously. Does TypeScript have an API of any sort for checking this?
More context in this Stack Overflow question.
I'm not sure if this is in scope of Knip, but it feels like it could be. In a nutshell, if I have a module like this:
And
foocomes with a corresponding@types/foo, then I need to make sure that it's actually independencies. Otherwisebar/dist/index.d.tswill be broken in any consumer ofbarthat doesn't have@types/fooin its dependency tree.The complication I'm seeing is determining whether a
@types/*actually ends up being used indist. And putting all@types/*independenciesdoesn't make sense, obviously. Does TypeScript have an API of any sort for checking this?More context in this Stack Overflow question.