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

Stricter typescript definitions #2922

Closed
lwolle opened this issue Jun 8, 2021 · 1 comment · Fixed by #3085
Closed

Stricter typescript definitions #2922

lwolle opened this issue Jun 8, 2021 · 1 comment · Fixed by #3085
Labels
Help Wanted Indicates that we’d especially appreciate community input in this issue Types Issues relating to the Typescript definition files

Comments

@lwolle
Copy link

lwolle commented Jun 8, 2021

The typescript definitions are a big help already, but on first sight they could be much stricter, and thus make development safer.

For example, the Event-type form @uppy/core resolves to
type Event = LiteralUnion<'file-added' | 'file-removed' | 'upload' | 'upload-progress' | 'upload-success' | 'complete' | 'error' | 'upload-error' | 'upload-retry' | 'info-visible' | 'info-hidden' | 'cancel-all' | 'restriction-failed' | 'reset-progress' | string & { }; which seems not quite ideal to me. This could to this exaggerated erroneous call to uppy.on: uppy.on('upload-errrOOOoooOOOOOrrrr'. Therefore I'd suggest to make these types stricter, and in the same run remove all the most of the any-types if possible

@Murderlon Murderlon added Help Wanted Indicates that we’d especially appreciate community input in this issue Types Issues relating to the Typescript definition files and removed Triage Feature labels Jun 9, 2021
@Murderlon
Copy link
Member

hi @lwolle, thanks for the suggestion. Stricter types are always a good idea and it's an ongoing effort. If there is anything in particular you'd like to quickly change, PRs are welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted Indicates that we’d especially appreciate community input in this issue Types Issues relating to the Typescript definition files
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants