-
-
Notifications
You must be signed in to change notification settings - Fork 125
Add Flow globals #307
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
base: main
Are you sure you want to change the base?
Add Flow globals #307
Conversation
address style issues add missing ReadOnlyArray
4822f10 to
1c08513
Compare
| - utilities: https://flow.org/en/docs/types/utilities/ | ||
| */ | ||
| export default { | ||
| $Exact: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a type utility, is this needed to lint flow files?
Does typescript-eslint provide similar things? I didn't see in typescript-eslint code base.
//cc @sindresorhus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see these in hermes-eslint either.
static_h is their dev branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of those functions are utility functions. Here is Exact https://flow.org/en/docs/types/utilities/#toc-exact. I think most common ones are $Keys and $Values.
As far as I remember with one of the updates, flow made all objects exact by default making this utility unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question is, they are for types, you can't use as value.
Hey, since the globals package is commonly used by linters (eslint, standard) to set up global variables for particular environment, I thought that it would be nice to add support for the flow type system.
This PR creates
flowenvironment and adds the following globals: