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

fix(cli): print number of warnings #184

Merged
merged 10 commits into from Mar 18, 2023

Conversation

tommy-mitchell
Copy link
Contributor

@tommy-mitchell tommy-mitchell commented Mar 14, 2023

Might resolve #166.

Changes the formatter to report the number of warnings and changes the CLI to exit successfully if only warnings are reported:

image

I want some feedback as well - should printType support printing generic arguments? I.e:

// assert.ts
export const printType = <T>(expression?: any) => {};

// index.test-d.ts
import {printType} from 'tsd';

type Severity = 'error' | 'warning';
printType<Severity>();
//=> 'Type for expression *Severity* is: *'error' | 'warning'*'

My only thought is that printType should only print either the generic or the expression, but not both.

This PR is dependent on #182.

@tommy-mitchell
Copy link
Contributor Author

I want some feedback as well - should printType support printing generic arguments?

On second thought, I’d rather explore this further (and other changes to assert.ts) in another PR.

@sindresorhus sindresorhus merged commit 3dcaae7 into tsdjs:main Mar 18, 2023
3 checks passed
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 this pull request may close these issues.

options for allow printType not throw error
2 participants