-
-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Description
Is your feature request related to a problem? Please describe.
Yes. After #3002 was merged, we are now required to set explicit type definitions for every single axios request we make, even if we don't want to, because these would result in an error.
Describe the solution you'd like
The default type for AxiosResponse#data should be any so that we can modify it if we want, or keep it as is if we don't care about the typings for that specific request
Describe alternatives you've considered
As suggested in that PR, we could set the type to any explicitly, however, many people use typescript-eslint's no-explicit-any rule that prevents us from doing this. I believe everyone should be able to choose what types they wanna work with, because for extremely simple responses from which you only need one or two simple properties you don't always need explicit type declarations
Additional context
TypeScript's DOM library sets the return type of Body#toJSON to Promise, so we should be following the native approach and not restricting user's options by setting a default that "most users may want", even if most users do not want this.