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

QuickInput: dangerous use of any #91877

Closed
bpasero opened this issue Mar 2, 2020 · 0 comments
Closed

QuickInput: dangerous use of any #91877

bpasero opened this issue Mar 2, 2020 · 0 comments
Assignees
Labels
debt Code quality issues quick-pick Quick-pick widget issues
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Mar 2, 2020

Looking into the following method:

pick<T extends IQuickPickItem, O extends IPickOptions<T>>(picks: Promise<QuickPickInput<T>[]> | QuickPickInput<T>[], options: O = <O>{}, token: CancellationToken = CancellationToken.None): Promise<O extends { canPickMany: true } ? T[] : T> {

There are a bunch of any usages that seem to hide the fact that the promise may return undefined. I suggest to remove the use of any in code as it bypasses the type checking of TypeScript entirely. If the type is really not known, rather use unknown instead and require casts at the place where it is being used.

@bpasero bpasero added debt Code quality issues quick-pick Quick-pick widget issues labels Mar 2, 2020
@chrmarti chrmarti added this to the April 2020 milestone Apr 8, 2020
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues quick-pick Quick-pick widget issues
Projects
None yet
Development

No branches or pull requests

2 participants