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

Cleanup nullability annotations #3334

Closed

Conversation

realityforge
Copy link
Contributor

@realityforge realityforge commented Apr 15, 2019

  • Remove ! if type is nonnull by default

@lauraharker
Copy link
Contributor

Created internal issue http://b/130555289

@lauraharker lauraharker added the internal-issue-created An internal Google issue has been created to track this GitHub issue label Apr 15, 2019
@lauraharker lauraharker self-assigned this Apr 15, 2019
@lauraharker
Copy link
Contributor

Google's style guide mandates that all non-primitive or literal type references must have an explicit ! or ?.
https://google.github.io/styleguide/jsguide.html#jsdoc-nullability

I'd be happy to see a few of the changes in this PR land, like !number to number or !function(... to function(..., but we can't accept this as is.

@realityforge could you revert the changes to non-primitive or literal types?

@realityforge
Copy link
Contributor Author

@lauraharker I believe it is good to go. Holler if there is something more that needs to be done.

Copy link
Contributor

@lauraharker lauraharker left a comment

Choose a reason for hiding this comment

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

Looks good except for ?undefined. Thanks!

externs/browser/window.js Outdated Show resolved Hide resolved
externs/browser/window.js Outdated Show resolved Hide resolved
@realityforge
Copy link
Contributor Author

@lauraharker Alright ... next attempt ;)

@lauraharker
Copy link
Contributor

Looks good to me. Importing for internal review.

jDramaix pushed a commit to google/elemental2 that referenced this pull request Apr 29, 2019
 - Remove ! when the primitive type is nonnull by default
 - Move nullability-marker "?" to the beginning of the type

Closes google/closure-compiler#3334.

PiperOrigin-RevId: 245823520
@blickly blickly closed this in 38dc998 Apr 29, 2019
@realityforge realityforge deleted the CleanupNullabilityAnnotations branch April 30, 2019 00:09
@realityforge
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes internal-issue-created An internal Google issue has been created to track this GitHub issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants