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

fix: fix http/index.d.ts types #1028

Merged
merged 3 commits into from
Sep 23, 2024
Merged

fix: fix http/index.d.ts types #1028

merged 3 commits into from
Sep 23, 2024

Conversation

trew
Copy link
Contributor

@trew trew commented Sep 13, 2024

This PR aims to improve the handcrafted typings in index.d.ts in order to allow projects that depend on this to have skipLibCheck set to false.

Since skipLibCheck is true in tsconfig.json (through extends config), index.d.ts is not compiled with tsc (see microsoft/TypeScript#30511).

I added a separate step (lint:tsc:types) that compiles this file specifically and also fixed the issues typescript complained about.

http/index.d.ts:1:13 - error TS1192: Module '"node:http"' has no default export.
1 import type http from 'node:http';

http/index.d.ts:2:13 - error TS1192: Module '"node:https"' has no default export.
2 import type https from 'node:https';

http/index.d.ts:19:15 - error TS2536: Type '"length"' cannot be used to index type 'Params'.
19 } & { length: Params['length'] };

@trew
Copy link
Contributor Author

trew commented Sep 19, 2024

@3846masa I would love to see this merged together with #1031 (which is removing a transitive dependency to deprecated module punycode) so I can update to latest version of http-cookie-agent. I'm currently stuck on an older version because of the compilation issues.

@3846masa 3846masa changed the title Fix handcrafted types fix: fix http/index.d.ts types Sep 23, 2024
@3846masa
Copy link
Owner

Thanks for your contribution. This PR will be released as v6.0.6 with #1031.

@3846masa 3846masa merged commit e597713 into 3846masa:main Sep 23, 2024
9 checks passed
3846masa pushed a commit that referenced this pull request Sep 23, 2024
## [6.0.6](v6.0.5...v6.0.6) (2024-09-23)

### Bug Fixes

* fix http/index.d.ts types ([#1028](#1028)) ([e597713](e597713))
@trew
Copy link
Contributor Author

trew commented Sep 23, 2024

Appreciate it!

@trew trew deleted the compile-types branch September 23, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants