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 TS type reference #187

Merged
merged 1 commit into from
Mar 10, 2021
Merged

Fix TS type reference #187

merged 1 commit into from
Mar 10, 2021

Conversation

carlpaten
Copy link
Contributor

@carlpaten carlpaten commented Mar 9, 2021

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 import anything from type-fest, from anywhere in my code, then suddenly that code compiles across my entire code base. This is a well-known issue, see e.g. microsoft/TypeScript#33901

The culprit was introduced in #37.

As a partial solution, I would recommend replacing the reference to esnext with a reference to es2020.bigint. Perhaps it would also be worth adding a caveat to the README to the effect that this library is only fully compatible with environments that support es2020.bigint.

@sindresorhus sindresorhus changed the title Replace reference to esnext with reference to es2020.bigint Fix TS type reference Mar 10, 2021
@sindresorhus
Copy link
Owner

Perhaps it would also be worth adding a caveat to the README to the effect that this library is only fully compatible with environments that support es2020.bigint.

That is already implied by the Node.js version target in package.json.

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.

None yet

2 participants