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

Test types #4140

Merged
merged 10 commits into from Oct 12, 2021
Merged

Test types #4140

merged 10 commits into from Oct 12, 2021

Conversation

remcohaszing
Copy link
Contributor

@remcohaszing remcohaszing commented Oct 5, 2021

This asserts the type definitions work as expected for TypeScript 3.0 and above. This is the initial setup. I want to keep this minimal and add proper type assertions and some type fixes later. This is why the referenced issue isn’t closed yet.

This also fixes the axios defaults headers type.

I believe it’s a good idea to get this merged fast, so other TypeScript related issues and pull requests can be resolved more confidently.

Refs #4134
Closes #4108
Closes #4117
Closes #4132
Closes #4153
Closes #4157

caugner and others added 5 commits October 4, 2021 17:24
`axios.headers` is not of the same type as `request.headers`, so a new type
`AxiosDefaults` was introduced
This asserts that the type definitions are valid in the specified TypeScript
version and above. This is the same tool that is used by DefinitelyTyped.
@jasonsaayman
Copy link
Member

@remcohaszing can you please have a look at the merge conflict, please ping me when resolved.

@jasonsaayman jasonsaayman self-assigned this Oct 6, 2021
@remcohaszing
Copy link
Contributor Author

@jasonsaayman resolved!

@remcohaszing
Copy link
Contributor Author

remcohaszing commented Oct 6, 2021

You may want to merge #4115 first. The same change is included here, but not that exact commit. That PR was first, so I believe @caugner deserves credits for that. :)

Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, no need to credit me for that missing semicolon

PS: Oops, too late, that PR is already merged.

index.d.ts Outdated
@@ -1,3 +1,19 @@
// TypeScript Version: 3.0

export interface HeadersDefaults {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason to add this interface here at the beginning, rather than towards the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. I didn’t really think about placement.

@remcohaszing
Copy link
Contributor Author

@jasonsaayman I’d like to point out #4066, #4136, and #4147 also look good. They don't conflict with each other, but some will cause conflict conflicts with this PR. If they all get merged, I can resolve the merge conflicts in here.

@jasonsaayman
Copy link
Member

Ok cool @remcohaszing I will look into all of that

@jasonsaayman
Copy link
Member

Seems that NPM had some downtime while I was trying to merge, I will look into this in a couple hours, thanks

@ssrikanta
Copy link

Any estimates, when this fix will be available would be very much helpful

@jasonsaayman
Copy link
Member

@remcohaszing can you mend these large merge conflicts then I can merge and do a release :)

@remcohaszing
Copy link
Contributor Author

@remcohaszing can you mend these large merge conflicts then I can merge and do a release :)

You were 2 seconds ahead of my push xD

@jasonsaayman
Copy link
Member

Thanks for this :) merging now

mbargiel pushed a commit to mbargiel/axios that referenced this pull request Jan 27, 2022
* Distinguish request and response data types

* Fix Axios headers type

`axios.headers` is not of the same type as `request.headers`, so a new type
`AxiosDefaults` was introduced

* Replace grunt-ts with dtslint

This asserts that the type definitions are valid in the specified TypeScript
version and above. This is the same tool that is used by DefinitelyTyped.

* Remove grunt-ts

* Restore typescript dependency

* Fix missing semicolons

Co-authored-by: Claas Augner <github@caugner.de>
Co-authored-by: Jay <jasonsaayman@gmail.com>
@remcohaszing remcohaszing deleted the test-types branch July 26, 2022 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment