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

Stop leaking TypeScript library definitions through dependent packages #24

Merged
merged 2 commits into from
Mar 24, 2021

Conversation

carlpaten
Copy link
Contributor

I'm targeting Node.js 12.x, which means that I shouldn't be able to compile e.g. "foo".replaceAll("a", "b"). But if I depend on ansi-codes, or any package that depends on it, then that code compiles without error. This is a well-known issue, see e.g. microsoft/TypeScript#33901.

This is caused by ansi-code dependency type-fest leaking library definitions. This is fixed in the latest version.

This PR is part of a campaign to stop major packages from leaking TypeScript library definitions. If you merge it and cut a release I can visit packages that depend on ansi-codes and help them upgrade.

@sindresorhus
Copy link
Owner

@carlpaten
Copy link
Contributor Author

carlpaten commented Mar 21, 2021

Node.js v8 didn't like the tsd upgrade. However it's been EOL for more than a year. Would it be fine to remove it from the CI checks?

index.test-d.ts Show resolved Hide resolved
@sindresorhus sindresorhus merged commit 0cbc92b into sindresorhus:main Mar 24, 2021
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.

3 participants