Skip to content

Commit 7b0eeb0

Browse files
SamChou19815facebook-github-bot
authored andcommitted
Cleanup codeless suppressions in xplat/js
Reviewed By: marcoww6 Differential Revision: D81552699 fbshipit-source-id: 71b104174a8ad7fbf360cdd87109ce034f49ec70
1 parent 82d3310 commit 7b0eeb0

File tree

7 files changed

+17
-46
lines changed

7 files changed

+17
-46
lines changed

packages/react-relay/__flowtests__/RelayModern-flowtest.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ class PluralTest extends React.Component<{
111111
}> {
112112
render(): React.Node {
113113
const names = this.props.users.map(user => user.name).filter(Boolean);
114-
// $FlowExpectedError
115114
(names: Array<string>);
116115
// $FlowExpectedError[incompatible-type]
117116
(names: Array<number>);
@@ -204,7 +203,6 @@ function cb(): void {}
204203
string="x"
205204
user={aUserRef}
206205
nullableUser={null}
207-
// $FlowExpectedError - optional, not nullable!
208206
optionalUser={null}
209207
/>;
210208

@@ -247,7 +245,6 @@ declare var aComplexUserRef: {
247245
<PluralTestFragment
248246
users={usersRef}
249247
nullableUsers={null}
250-
// $FlowExpectedError - optional, not nullable!
251248
optionalUsers={null}
252249
/>;
253250

packages/react-relay/relay-hooks/__flowtests__/useBlockingPaginationFragment-flowtest.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,17 @@ type ExpectedReturnType<
6060
keyNullable,
6161
): ExpectedReturnType<QueryVariables, QueryVariables, NullableData>);
6262

63-
// $FlowExpectedError: can't cast nullable to non-nullable
6463
// $FlowFixMe[react-rule-hook]
65-
// $FlowFixMe[incompatible-type]
64+
// $FlowFixMe[incompatible-type] can't cast nullable to non-nullable
6665
(useBlockingPaginationFragment(
6766
refetchableFragmentInput,
6867
keyNullable,
6968
): ExpectedReturnType<QueryVariables, QueryVariables, NonNullableData>);
7069

71-
// $FlowExpectedError: actual type of returned data is correct
7270
// $FlowFixMe[react-rule-hook]
7371
// $FlowFixMe[incompatible-exact]
7472
// $FlowFixMe[prop-missing]
75-
// $FlowFixMe[incompatible-type]
73+
// $FlowFixMe[incompatible-type] actual type of returned data is correct
7674
(useBlockingPaginationFragment(
7775
refetchableFragmentInput,
7876
// $FlowExpectedError[incompatible-type]
@@ -87,22 +85,19 @@ type ExpectedReturnType<
8785
keyAnotherNullable,
8886
): ExpectedReturnType<QueryVariables, QueryVariables, NullableData>);
8987

90-
// $FlowExpectedError: Key should not be a user provided object
9188
// $FlowFixMe[react-rule-hook]
92-
// $FlowFixMe[incompatible-type]
89+
// $FlowFixMe[incompatible-type] Key should not be a user provided object
9390
// $FlowFixMe[cannot-resolve-name]
9491
useBlockingPaginationFragment(fragmentInput, {abc: 123});
9592

96-
// $FlowExpectedError: Key should not be an empty object
9793
// $FlowFixMe[react-rule-hook]
98-
// $FlowFixMe[incompatible-type]
94+
// $FlowFixMe[incompatible-type] Key should not be an empty object
9995
// $FlowFixMe[cannot-resolve-name]
10096
useBlockingPaginationFragment(fragmentInput, {});
10197

102-
// $FlowExpectedError: Key should be the `<name>$key` type from generated flow
10398
// $FlowFixMe[react-rule-hook]
10499
// $FlowFixMe[incompatible-type]
105-
// $FlowFixMe[cannot-resolve-name]
100+
// $FlowFixMe[cannot-resolve-name] Key should be the `<name>$key` type from generated flow
106101
useBlockingPaginationFragment(fragmentInput, fragmentData);
107102

108103
// Refetch function options:

packages/react-relay/relay-hooks/__flowtests__/usePaginationFragment-flowtest.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,22 @@ type ExpectedReturnType<
6262
keyNullable,
6363
): ExpectedReturnType<QueryVariables, QueryVariables, NullableData>);
6464

65-
// $FlowExpectedError: can't cast nullable to non-nullable
6665
// $FlowFixMe[react-rule-hook]
67-
// $FlowFixMe[incompatible-type]
66+
// $FlowFixMe[incompatible-type] can't cast nullable to non-nullable
6867
(usePaginationFragment(
6968
refetchableFragmentInput,
7069
keyNullable,
7170
): ExpectedReturnType<QueryVariables, QueryVariables, NonNullableData>);
7271

73-
// $FlowExpectedError: actual type of returned data is correct
7472
// $FlowFixMe[react-rule-hook]
7573
// $FlowFixMe[incompatible-exact]
7674
// $FlowFixMe[prop-missing]
77-
// $FlowFixMe[incompatible-type]
75+
// $FlowFixMe[incompatible-type] actual type of returned data is correct
7876
(usePaginationFragment(
7977
refetchableFragmentInput,
8078
// $FlowFixMe[incompatible-type]
8179
keyAnotherNonNullable,
8280
): ExpectedReturnType<QueryVariables, QueryVariablesSubset, NonNullableData>);
83-
// $FlowExpectedError
8481
// $FlowFixMe[react-rule-hook]
8582
// $FlowFixMe[incompatible-type]
8683
(usePaginationFragment(
@@ -89,19 +86,16 @@ type ExpectedReturnType<
8986
keyAnotherNullable,
9087
): ExpectedReturnType<QueryVariables, QueryVariables, NonNullableData>);
9188

92-
// $FlowExpectedError: Key should not be a user provided object
9389
// $FlowFixMe[react-rule-hook]
94-
// $FlowFixMe[incompatible-type]
90+
// $FlowFixMe[incompatible-type] Key should not be a user provided object
9591
usePaginationFragment(refetchableFragmentInput, {abc: 123});
9692

97-
// $FlowExpectedError: Key should not be an empty object
9893
// $FlowFixMe[react-rule-hook]
99-
// $FlowFixMe[incompatible-type]
94+
// $FlowFixMe[incompatible-type] Key should not be an empty object
10095
usePaginationFragment(refetchableFragmentInput, {});
10196

102-
// $FlowExpectedError: Key should be the `<name>$key` type from generated flow
10397
// $FlowFixMe[react-rule-hook]
104-
// $FlowFixMe[incompatible-type]
98+
// $FlowFixMe[incompatible-type] Key should be the `<name>$key` type from generated flow
10599
usePaginationFragment(refetchableFragmentInput, fragmentData);
106100

107101
// Refetch function options:

packages/react-relay/relay-hooks/__flowtests__/useRefetchableFragment-flowtest.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,55 +46,48 @@ import {
4646
FetchFn<QueryVariables>,
4747
]);
4848

49-
// $FlowExpectedError: can't cast nullable to non-nullable
5049
// $FlowFixMe[react-rule-hook]
51-
// $FlowFixMe[incompatible-type]
50+
// $FlowFixMe[incompatible-type] can't cast nullable to non-nullable
5251
(useRefetchableFragment(refetchableFragmentInput, keyNullable): [
5352
NonNullableData,
5453
FetchFn<QueryVariables>,
5554
]);
5655

57-
// $FlowExpectedError: refetch requires exact type if key is nullable
5856
// $FlowFixMe[react-rule-hook]
5957
// $FlowFixMe[incompatible-exact]
60-
// $FlowFixMe[incompatible-type]
58+
// $FlowFixMe[incompatible-type] refetch requires exact type if key is nullable
6159
(useRefetchableFragment(refetchableFragmentInput, keyNullable): [
6260
NullableData,
6361
FetchFn<QueryVariablesSubset>,
6462
]);
6563

66-
// $FlowExpectedError: actual type of returned data is correct
6764
// $FlowFixMe[react-rule-hook]
6865
// $FlowFixMe[incompatible-type]
6966
// $FlowFixMe[incompatible-exact]
7067
// $FlowFixMe[prop-missing]
71-
// $FlowFixMe[incompatible-type]
68+
// $FlowFixMe[incompatible-type] actual type of returned data is correct
7269
(useRefetchableFragment(refetchableFragmentInput, keyAnotherNonNullable): [
7370
NonNullableData,
7471
FetchFn<QueryVariablesSubset>,
7572
]);
7673

77-
// $FlowExpectedError - incompatible key types
7874
// $FlowFixMe[react-rule-hook]
79-
// $FlowFixMe[incompatible-type]
75+
// $FlowFixMe[incompatible-type]: incompatible key types
8076
(useRefetchableFragment(refetchableFragmentInput, keyAnotherNullable): [
8177
NullableData,
8278
FetchFn<QueryVariables>,
8379
]);
8480

85-
// $FlowExpectedError: Key should not be a user provided object
8681
// $FlowFixMe[react-rule-hook]
87-
// $FlowFixMe[incompatible-type]
82+
// $FlowFixMe[incompatible-type] Key should not be a user provided object
8883
useRefetchableFragment(refetchableFragmentInput, {abc: 123});
8984

90-
// $FlowExpectedError: Key should not be an empty object
9185
// $FlowFixMe[react-rule-hook]
92-
// $FlowFixMe[incompatible-type]
86+
// $FlowFixMe[incompatible-type] Key should not be an empty object
9387
useRefetchableFragment(refetchableFragmentInput, {});
9488

95-
// $FlowExpectedError: Key should be the `<name>$key` type from generated flow
9689
// $FlowFixMe[react-rule-hook]
97-
// $FlowFixMe[incompatible-type]
90+
// $FlowFixMe[incompatible-type] Key should be the `<name>$key` type from generated flow
9891
useRefetchableFragment(refetchableFragmentInput, fragmentData);
9992

10093
// Refetch function options:

packages/relay-runtime/store/StoreInspector.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ if (__DEV__) {
145145
return record;
146146
}
147147
return new Proxy(
148-
// $FlowFixMe: Do not assume that record is an object
149148
{...record},
150149
{
151150
get(target, prop) {

packages/relay-runtime/store/__tests__/observeQuery-test.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ test('resolver suspense suspends', async () => {
114114
environment.commitPayload(operation, {
115115
me: {id: '7', __typename: 'User', name: 'Elizabeth'},
116116
});
117-
// $FlowFixMe Data is untyped
118117
const observable = observeQuery(environment, query, variables);
119118
withObservableValues(observable, results => {
120119
GLOBAL_STORE.dispatch({type: 'INCREMENT'});
@@ -246,7 +245,6 @@ test('Resolver error with @throwOnFieldError', async () => {
246245
const variables = {};
247246
const operation = createOperationDescriptor(query, variables);
248247
environment.commitPayload(operation, {me: {id: '7', __typename: 'User'}});
249-
// $FlowFixMe Data is untyped
250248
const observable = observeQuery(environment, query, variables);
251249
withObservableValues(observable, results => {
252250
expect(results).toEqual([
@@ -278,7 +276,6 @@ test('Resolver with client edge to server object', async () => {
278276
environment.commitPayload(operation, {me: {id: '7', __typename: 'User'}});
279277
let result;
280278
try {
281-
// $FlowFixMe Data is untyped
282279
const observable = observeQuery(environment, query, variables);
283280
// Today we never get to this, but once client edges are supported, we will
284281
withObservableValues(observable, results => {
@@ -315,7 +312,6 @@ test('data goes missing due to unrelated query response', async () => {
315312
environment.commitPayload(operation, {
316313
me: {id: '7', __typename: 'User', name: 'Elizabeth'},
317314
});
318-
// $FlowFixMe Data is untyped
319315
const observable = observeQuery(environment, query, variables);
320316

321317
// Now an unrelated query comes in and changes the Query.me relationship to a
@@ -358,7 +354,6 @@ test('data goes missing due to unrelated query response (@throwOnFieldErrro)', a
358354
environment.commitPayload(operation, {
359355
me: {id: '7', __typename: 'User', name: 'Elizabeth'},
360356
});
361-
// $FlowFixMe Data is untyped
362357
const observable = observeQuery(environment, query, variables);
363358

364359
// Now an unrelated query comes in and changes the Query.me relationship to a

packages/relay-runtime/store/__tests__/waitForFragmentData-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ test('data goes missing due to unrelated query response', async () => {
154154
me: {id: '7', __typename: 'User', name: 'Elizabeth'},
155155
});
156156
const {data} = environment.lookup(operation.fragment);
157-
// $FlowFixMe Data is untyped
158157

159158
// Now an unrelated query comes in and changes the Query.me relationship to a
160159
// new user, but does not fetch `name` for that user. Now we are missing data
@@ -202,7 +201,6 @@ test('data goes missing due to unrelated query response (@throwOnFieldErrro)', a
202201
me: {id: '7', __typename: 'User', name: 'Elizabeth'},
203202
});
204203
const {data} = environment.lookup(operation.fragment);
205-
// $FlowFixMe Data is untyped
206204

207205
// Now an unrelated query comes in and changes the Query.me relationship to a
208206
// new user, but does not fetch `name` for that user. Now we are missing data

0 commit comments

Comments
 (0)