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

allow web3-utils to work in projects with "noImplicitAny": true, #2280

Merged
merged 3 commits into from
Feb 4, 2019
Merged

allow web3-utils to work in projects with "noImplicitAny": true, #2280

merged 3 commits into from
Feb 4, 2019

Conversation

joshstevens19
Copy link
Contributor

Description

On TS projects if you set

"noImplicitAny": true,

TS will throw a error

ERROR in node_modules/web3-utils/types/index.d.ts(23,23): error TS7016: Could not find a declaration file for module 'bn.js'. 'C:/Users/Josh Stevens/repos/Project/node_modules/bn.js/lib/bn.js' implicitly has an 'any' type.
  Try `npm install @types/bn.js` if it exists or add a new declaration (.d.ts) file containing `declare module 'bn.js';`

We shouldn't force the developer to install that typing in their project so i have brought it in as a dependency in web3-utils which fixes this.

Type of change

  • Bug fix
  • New feature
  • Breaking change

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no warnings.
  • I have updated or added types for all modules I've changed
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run test in the root folder with success and extended the tests if necessary.
  • I ran npm run build in the root folder and tested it in the browser and with node.
  • I ran npm run dtslint in the root folder and tested that all my types are correct
  • I have tested my code on the live network.

@joshstevens19 joshstevens19 requested a review from nivida January 31, 2019 11:57
@nivida nivida added the Types Incorrect or missing types label Feb 3, 2019
@nivida nivida merged commit 8b46c65 into web3:1.0 Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Types Incorrect or missing types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants