Revert recent Flow syntax codemods in react-native-github (#56998)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56998

Reverts the recent Flow syntax codemods applied across `packages/`, `private/`, and `scripts/` in react-native-github. Specifically restores the previous form for:

- `+T` / `+Instance` style variance annotations on generic type parameters that had been converted to the newer `out T` / `in T` keyword form.
- `+field:` covariant object/interface properties that had been converted to the `readonly field:` modifier form.
- `+[K in keyof T]:` mapped-type covariance that had been converted to `readonly [K in keyof T]:`.

These are purely Flow type-annotation changes with no runtime behavior impact, restoring the form that the rest of the toolchain (in particular Fantom) already supports.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D106813102

fbshipit-source-id: 6bf915d530e130eba9c9d96a2b6c3dc8853594d1
This commit is contained in:
Rubén Norte authored and meta-codesync[bot] committed 2026-05-29 14:09:58 -07:00
1 parent 5b16cdff9d
commit 833144fcec
232 files changed
+1487 -1668

No files matched your search

@@ -14,8 +14,8 @@ import type {NodePath, Visitor} from '@babel/traverse';
const t = require('@babel/types');
export type GatherTypeAliasesVisitorState = {
readonly aliasToPathMap: Map<string, NodePath<t.TSTypeAliasDeclaration>>,
readonly interfaceToPathMap?: Map<string, NodePath<t.TSInterfaceDeclaration>>,
+aliasToPathMap: Map<string, NodePath<t.TSTypeAliasDeclaration>>,
+interfaceToPathMap?: Map<string, NodePath<t.TSInterfaceDeclaration>>,
};
/**
@@ -21,7 +21,7 @@ const debug = require('debug')('build-types:transforms:inlineTypes');
// TODO: Handle more builtin TS types
const builtinTypeResolvers: {
readonly [K: string]: (
+[K: string]: (
path: NodePath<t.TSTypeReference>,
state: BaseVisitorState,
tsTypeResolver?: TSTypeResolver,
@@ -18,7 +18,7 @@ const t = require('@babel/types');
const debug = require('debug')('build-types:transforms:inlineTypes');
const typeOperatorResolvers: {
readonly [K: string]: (
+[K: string]: (
path: NodePath<t.TSTypeOperator>,
state: BaseVisitorState,
) => void,