sindresorhus / ansi-escapes

ANSI escape codes for manipulating the terminal
MIT License
485 stars 44 forks source link

Stop leaking TypeScript library definitions through dependent packages #24

Closed carlpaten closed 3 years ago

carlpaten commented 3 years ago

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. https://github.com/microsoft/TypeScript/issues/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 commented 3 years ago

https://github.com/sindresorhus/ansi-escapes/pull/24/checks#step:5:20

carlpaten commented 3 years ago

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?