Skip to content

Commit d041e8b

Browse files
marcoww6facebook-github-bot
authored andcommitted
Pre-suppression errors for functionT in xplat js (#52820)
Summary: Pull Request resolved: #52820 Reviewed By: SamChou19815 Differential Revision: D78941100 fbshipit-source-id: 66d462670471212d23e8682bd5bf1ebd79ef4582
1 parent 8e2b33f commit d041e8b

10 files changed

Lines changed: 30 additions & 0 deletions

File tree

packages/community-cli-plugin/src/commands/start/runServer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ async function runServer(
127127
const reporter: Reporter = {
128128
update(event: TerminalReportableEvent) {
129129
terminalReporter.update(event);
130+
/* $FlowFixMe[constant-condition] Error discovered during Constant
131+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
130132
if (reportEvent) {
131133
reportEvent(event);
132134
}

packages/polyfills/error-guard.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ const ErrorUtils = {
4242
return _globalHandler;
4343
},
4444
reportError(error: mixed): void {
45+
/* $FlowFixMe[constant-condition] Error discovered during Constant
46+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
4547
_globalHandler && _globalHandler(error, false);
4648
},
4749
reportFatalError(error: mixed): void {
4850
// NOTE: This has an untyped call site in Metro.
51+
/* $FlowFixMe[constant-condition] Error discovered during Constant
52+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
4953
_globalHandler && _globalHandler(error, true);
5054
},
5155
applyWithGuard<TArgs: $ReadOnlyArray<mixed>, TOut>(

packages/react-native/Libraries/Alert/RCTAlertManager.android.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export function alertWithArgs(
2828
args,
2929
emptyCallback,
3030
// $FlowFixMe[incompatible-call] - Mismatched platform interfaces.
31+
/* $FlowFixMe[constant-condition] Error discovered during Constant
32+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
3133
callback || emptyCallback,
3234
);
3335
}

packages/react-native/Libraries/Animated/AnimatedImplementation.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ const _combineCallbacks = function (
9494
if (callback && config.onComplete) {
9595
return (...args: Array<EndResult>) => {
9696
config.onComplete && config.onComplete(...args);
97+
/* $FlowFixMe[constant-condition] Error discovered during Constant
98+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
9799
callback && callback(...args);
98100
};
99101
} else {

packages/react-native/Libraries/Animated/Easing.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ const EasingStatic = {
9191
* http://cubic-bezier.com/#.42,0,1,1
9292
*/
9393
ease(t: number): number {
94+
/* $FlowFixMe[constant-condition] Error discovered during Constant
95+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
9496
if (!ease) {
9597
ease = EasingStatic.bezier(0.42, 0, 1, 1);
9698
}

packages/react-native/Libraries/Animated/animations/TimingAnimation.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export type TimingAnimationConfigSingle = $ReadOnly<{
4949

5050
let _easeInOut;
5151
function easeInOut() {
52+
/* $FlowFixMe[constant-condition] Error discovered during Constant Condition
53+
* roll out. See https://fburl.com/workplace/1v97vimq. */
5254
if (!_easeInOut) {
5355
const Easing = require('../Easing').default;
5456
_easeInOut = Easing.inOut(Easing.ease);

packages/react-native/Libraries/BatchedBridge/MessageQueue.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ class MessageQueue {
162162

163163
getCallableModule(name: string): {...} | null {
164164
const getValue = this._lazyCallableModules[name];
165+
/* $FlowFixMe[constant-condition] Error discovered during Constant
166+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
165167
return getValue ? getValue() : null;
166168
}
167169

@@ -466,6 +468,8 @@ class MessageQueue {
466468
const profileName = debug
467469
? '<callback for ' + module + '.' + method + '>'
468470
: cbID;
471+
/* $FlowFixMe[constant-condition] Error discovered during Constant
472+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
469473
if (callback && this.__spy) {
470474
this.__spy({type: TO_JS, module: null, method: profileName, args});
471475
}

packages/react-native/Libraries/LayoutAnimation/LayoutAnimation.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ function configureNext(
108108
if (UIManager?.configureNextLayoutAnimation) {
109109
UIManager.configureNextLayoutAnimation(
110110
config,
111+
/* $FlowFixMe[constant-condition] Error discovered during Constant
112+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
111113
onAnimationComplete ?? function () {},
112114
onAnimationDidFail ??
113115
function () {} /* this should never be called in Non-Fabric */,

packages/react-native/src/private/animated/NativeAnimatedHelper.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ const NativeOperations = createNativeOperations();
140140
const API = {
141141
getValue: (isSingleOpBatching
142142
? (tag, saveValueCallback) => {
143+
/* $FlowFixMe[constant-condition] Error discovered during Constant
144+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
143145
if (saveValueCallback) {
144146
eventListenerGetValueCallbacks[tag] = saveValueCallback;
145147
}
@@ -264,6 +266,8 @@ const API = {
264266

265267
startAnimatingNode: (isSingleOpBatching
266268
? (animationId, nodeTag, config, endCallback) => {
269+
/* $FlowFixMe[constant-condition] Error discovered during Constant
270+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
267271
if (endCallback) {
268272
eventListenerAnimationFinishedCallbacks[animationId] = endCallback;
269273
}
@@ -349,6 +353,8 @@ function ensureGlobalEventEmitterListeners() {
349353
params => {
350354
const {tag} = params;
351355
const callback = eventListenerGetValueCallbacks[tag];
356+
/* $FlowFixMe[constant-condition] Error discovered during Constant
357+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
352358
if (!callback) {
353359
return;
354360
}
@@ -365,6 +371,8 @@ function ensureGlobalEventEmitterListeners() {
365371
for (const animation of animations) {
366372
const {animationId} = animation;
367373
const callback = eventListenerAnimationFinishedCallbacks[animationId];
374+
/* $FlowFixMe[constant-condition] Error discovered during Constant
375+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
368376
if (callback) {
369377
callback(animation);
370378
delete eventListenerAnimationFinishedCallbacks[animationId];

packages/virtualized-lists/Lists/VirtualizedList.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,8 @@ class VirtualizedList extends StateSafePureComponent<
440440
);
441441

442442
invariant(
443+
/* $FlowFixMe[constant-condition] Error discovered during Constant
444+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
443445
getItemCount,
444446
'VirtualizedList: The "getItemCount" prop must be provided',
445447
);

0 commit comments

Comments
 (0)