-
Notifications
You must be signed in to change notification settings - Fork 757
Description
When BigNumber is imported into TypeScript projects at least once, it pollutes the namespace and allows for usage without importing in other files. This is fine when used just as a type, but causes runtime errors if used such as const x = new BigNumber(1); These runtime errors are not caught by linting / typecheck.
This behavior is not present in the decimal.js package.
See this minimal reproducible example here. This is a nextjs hello world app with decimal.js and bignumber.js imported, and shows how the latter pollutes the namespace.
Issue #143 ran into a similar issue – apparently it was fixed, but perhaps not fully or the concerning behavior returned.
UPDATE (see below): next.js build catches the missing import, but React Native Expo build does not.