Skip to content

remove JSDOC object->any rewrite for noImplicitAny #35661

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

Merged
merged 3 commits into from
Dec 20, 2019

Conversation

sandersn
Copy link
Member

Turns out only the Object -> any rewrite got removed. We may have already done some analysis of this change, but I created this PR to easily run it again.

Fixes #34980

@sandersn
Copy link
Member Author

@typescript-bot user test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 13, 2019

Heya @sandersn, I've started to run the parallelized community code test suite on this PR at 16c36d0. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@sandersn
Copy link
Member Author

By the numbers:

  • 7 failures in compiler tests
  • 19 new failures in axios
  • 1 failure in content-disposition
  • 4 failures in prettier
  • 97 new failures in webpack

I know that webpack and prettier use checkJS; 97 new errors in webpack is concerning.

The new error in content-disposition is good -- catches a bare return when the function claims to return object. (assuming strictNullChecks, which the test suite does)

I'll look at the axios-src, prettier, and webpack failures next.

@sandersn
Copy link
Member Author

axios-src has

  • 1 usage where object is clearly used to mean { [s: string]: any }.
  • 1 usage where it basically means any.

prettier

  • 1 options usage where at least they said "TBD???"

@sandersn
Copy link
Member Author

webpack has

  • 1 frequently used property where object means any in a TBD sort of sense.

There might some others but I ran out of time to look at all the errors -- most of them are the same missing properties from the aforementioned object.

Overall, I think it's clear that real uses of object as any, or at least a string index signature, exist. I'm going to put this change behind --noImplicitAny like the Object change.

@sandersn sandersn changed the title remove JSDOC object->any rewrite remove JSDOC object->any rewrite for noImplicitAny Dec 13, 2019
@sandersn
Copy link
Member Author

I'll fix up any test failures tomorrow.

@sandersn
Copy link
Member Author

@weswigham @andrewbranch ping!

Copy link
Member

@andrewbranch andrewbranch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would personally love if we could do this without noImplicitAny, because when I choose to use JS+JSDoc instead of TS, it’s often because I have a bunch of untyped dependencies and writing definitions/stubs for them doesn’t feel worth it, so I disable noImplicitAny, but I still know what object means. But, webpack is probably more important than me 😛

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.

Provide easier access to object in JavaScript JSDoc
3 participants