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

Refine options Flow type #1204

Merged

Conversation

reyronald
Copy link
Contributor

Using Flow's Object types is actually a violation of the unclear-type linting rule:

unclear-type

Triggers when you use any, Object, or Function as type annotations. These types are unsafe.

So, using it to type the exported options object may cause issues for developers that have Flow linting enabled. Also, specifically typing this will result in a better developer experience anyway :)

As I started typing it, I ended up having to use Function and any elsewhere. Ideally those types should be refined too, but since I'm not familiar with Preact's internals I decided to leave it as-is and maybe a reviewer can suggest the right direction?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 39abf38 on reyronald:refine-options-flow-type into 30c0fd7 on developit:master.

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

Awesome, really appreciate improvements to the FLOW experience. Thanks for making a great PR 👍

@marvinhagemeister marvinhagemeister merged commit 62c04e0 into preactjs:master Sep 5, 2018
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.

None yet

3 participants