Allow `types` field in tsconfig
OliverJAsh opened this issue · 2 comments
Hi,
We want to use dtslint solely for the expect
rule it provides. We have evaluated alternative tools such as tsd
(as recommended in the README
) but they do not yet provide all the behavior we need.
However, the dtslint CLI disallows the types
compiler option. This probably makes sense for DefinitelyTyped, but it doesn't seem to make sense for other projects where this tool may be used.
Does it make sense to allow the types
field, perhaps as a flag to the CLI?
Hey @sandersn, would you consider a PR for this?
Well, I'd prefer to see a PR to tsd, since you only want expect
from dtslint anyway. I'd prefer to keep dtslint as single-purpose as possible to reduce the security complexity for types publishing. Simplicity is a distant ideal for dtslint, I know, but I don't want to move further away from it.
Side note: the kind of test you proposed on the tsd repo sounds to me like it's only appropriate for the public API. In that case, it does seem reasonable to write tests against the generated d.ts. For Typescript we use a baseline test, but a series of unit tests would be about the same. As you point out, of course, the workflow for generating a d.ts to test is more involved.