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

Make the default type of response data never #3002

Merged
merged 2 commits into from Sep 5, 2021

Commits on Jun 7, 2020

  1. Make the default type of response data never

    This requires TypeScript users to explicitly define the type of the data they
    are consuming.
    
    Before this, data was `any` by default. This means TypeScript consumers didn’t
    get type safety if they forgot to specify the type.
    
    Technically this is a breaking change for TypeScript users, as this will report
    errors if they forgot to specifiy the response type. The simplest workaround
    would be to explicitly set the response type to `any`, so it’s not breaking
    much.
    
    The `unknown` type is probably a slightly better fit, but this requires
    TypeScript ^3.
    
    `data` is still `any` in the very specific use case mentioned in
    microsoft/TypeScript#38969
    remcohaszing committed Jun 7, 2020
    Copy the full SHA
    a5eb689 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2021

  1. Copy the full SHA
    bffa86e View commit details
    Browse the repository at this point in the history