tsdjs/tsd

Export formatter

RebeccaStevens opened this issue · 2 comments

Could you export the formatter so that when running programmatically, we can generate the same formatting output?

The formatter is just a wrapper around eslint-formatter-pretty:

https://github.com/SamVerschueren/tsd/blob/fc516e18fd52ba2387f791c38e302e351703d944/source/lib/formatter.ts#L17-L39

This function is called with all of the diagnostics and then just uses the mentioned formatter as output. You can replicate it if needed.

I think unless #75 or something similar lands, it doesn’t make sense to output the formatted diagnostics when using tsd programmatically (since that would be a breaking change).

I think unless #75 or something similar lands, it doesn’t make sense to output the formatted diagnostics when using tsd programmatically (since that would be a breaking change).

Ignore me, I misunderstood the request. You just wanted a way to access the formatter in addition to the diagnostics, correct?