Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export formatter #147

Closed
RebeccaStevens opened this issue Jun 2, 2022 · 2 comments · Fixed by #179
Closed

Export formatter #147

RebeccaStevens opened this issue Jun 2, 2022 · 2 comments · Fixed by #179

Comments

@RebeccaStevens
Copy link

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

@tommy-mitchell
Copy link
Contributor

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).

@tommy-mitchell
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants