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

objects to any on typing's return + dtslint fix + general test fixes #2516

Merged
merged 20 commits into from
Mar 18, 2019
Merged

objects to any on typing's return + dtslint fix + general test fixes #2516

merged 20 commits into from
Mar 18, 2019

Conversation

joshstevens19
Copy link
Contributor

@joshstevens19 joshstevens19 commented Mar 15, 2019

Description

Return properties should never be a object they should be any if we can not write generic types for it. If it returns a object we get issues like this:

const test = web3.something.which.returns.object();
test.hey // wont compile 

This PR fixes this and should be the general rule for any return types that we can not write a interface for. Obviously we should be trying to write a interface for everything but there are conditions where you have to use any. Fixed this throughout. Even if the types are not in the public API this is what we should follow.

This PR will also fix some bad test typings + dstlint.

dtslint has been rolled back to a fix version of 0.4.2 and as Microsoft have now exposed definitelytyped-header-parser as a npm page i have brought that into our dev dependencies which allows it to work on node 8 + node 9 + node 10 + node 11:10 builds on Travis. This is now all working as expected and should be merged into master ASAP to avoid merge conflicts of package-locks.json files and to fix master build. 👍

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Enhancement

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 an ethereum test network.

@joshstevens19 joshstevens19 changed the title @types/objects to any return types objects to any on typing's return Mar 15, 2019
@coveralls
Copy link

coveralls commented Mar 15, 2019

Coverage Status

Coverage decreased (-0.01%) to 98.494% when pulling 6d5473f on joshstevens19:@types/objects-to-any-return-types into cd32de2 on ethereum:1.0.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 98.494% when pulling f15fb64 on joshstevens19:@types/objects-to-any-return-types into cd32de2 on ethereum:1.0.

@joshstevens19 joshstevens19 requested a review from nivida March 15, 2019 18:00
@joshstevens19 joshstevens19 changed the title objects to any on typing's return objects to any on typing's return + fix dtslint build Mar 15, 2019
@joshstevens19 joshstevens19 changed the title objects to any on typing's return + fix dtslint build objects to any on typing's return Mar 15, 2019
@joshstevens19 joshstevens19 changed the title objects to any on typing's return objects to any on typing's return + dtslint fix + general test fixes Mar 15, 2019
@joshstevens19 joshstevens19 added the Types Incorrect or missing types label Mar 16, 2019
@nivida nivida merged commit 7739107 into web3:1.0 Mar 18, 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.

3 participants