Commit Graph

3 Commits

Author SHA1 Message Date
kassens 30755244ec [flow] enable enforce_local_inference_annotations (#25921)
This setting is an incremental path to the next Flow version enforcing
type annotations on most functions (except some inline callbacks).

Used
```
node_modules/.bin/flow codemod annotate-functions-and-classes --write .
```
to add a majority of the types with some hand cleanup when for large
inferred objects that should just be `Fiber` or weird constructs
including `any`.

Suppressed the remaining issues.

Builds on #25918

DiffTrain build for [0b4f443020](https://github.com/facebook/react/commit/0b4f443020af386f2b48c47c074cb504ed672dc8)
[View git log for this commit](https://github.com/facebook/react/commits/0b4f443020af386f2b48c47c074cb504ed672dc8)
2023-01-09 20:54:59 +00:00
kassens f7173f143a Transform updates to support Flow this annotation syntax (#25918)
Flow introduced a new syntax to annotated the context type of a
function, this tries to update the rest and add 1 example usage.

- 2b1fb91a55 already added the changes
required for eslint.
- Jest transform is updated to use the recommended `hermes-parser` which
can parse current and Flow syntax and will be updated in the future.
- Rollup uses a new plugin to strip the flow types. This isn't ideal as
the npm module is deprecated in favor of using `hermes-parser`, but I
couldn't figure out how to integrate that with Rollup.

DiffTrain build for [b83baf63f7](https://github.com/facebook/react/commit/b83baf63f71669ca7bf222afec305b7a6fd782b7)
[View git log for this commit](https://github.com/facebook/react/commits/b83baf63f71669ca7bf222afec305b7a6fd782b7)
2023-01-05 20:50:52 +00:00
poteto 75dd049c3b Build for 832f07679597aa55b3442645b6429018c67e3540 2022-11-21 21:43:47 +00:00