Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Commit

Permalink
Resolve $FlowFixMeEmpty blocking open source Flow (#1941)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #1941

Resolve some `$FlowFixMeEmpty` annotations that were added in codemods that are breaking open source Flow for GitHub CI testing.

Also add `$FlowFixMeEmpty` as a supressing type for open source to avoid future code-mods breaking CI testing.

Reviewed By: mondaychen

Differential Revision: D38561891

fbshipit-source-id: f538a4f8fbc3f29092277a4ba6ab0db0ee30089d
drarmstr authored and facebook-github-bot committed Aug 10, 2022
1 parent caf0faa commit 3c9e211
Showing 3 changed files with 6 additions and 22 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ module.system=node

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeEmpty
suppress_type=$FlowOSSFixMe

module.name_mapper='React' -> '<PROJECT_ROOT>/node_modules/react'
2 changes: 1 addition & 1 deletion packages/recoil/caches/Recoil_TreeCache.js
Original file line number Diff line number Diff line change
@@ -231,7 +231,7 @@ class TreeCache<T = mixed> {
this._root = null;
}

invalidCacheError(): $FlowFixMeEmpty {
invalidCacheError(): ChangedPathError {
const CHANGED_PATH_ERROR_MESSAGE = isFastRefreshEnabled()
? 'Possible Fast Refresh module reload detected. ' +
'This may also be caused by an selector returning inconsistent values. ' +
25 changes: 4 additions & 21 deletions packages/recoil/recoil_values/__tests__/Recoil_selector-test.js
Original file line number Diff line number Diff line change
@@ -8,7 +8,9 @@
* @format
* @oncall recoil
*/

'use strict';

import type {Loadable} from '../../adt/Recoil_Loadable';
import type {RecoilValue} from '../../core/Recoil_RecoilValue';
import type {RecoilState} from 'Recoil';
@@ -90,33 +92,14 @@ function getError(recoilValue): Error {
return error;
}

function setValue(
recoilState:
| RecoilState<string>
| $IMPORTED_TYPE$_RecoilState_1<null>
| $IMPORTED_TYPE$_RecoilState_1<$FlowFixMeEmpty>
| $IMPORTED_TYPE$_RecoilState_1<number>
| $IMPORTED_TYPE$_RecoilState_1<$TEMPORARY$string<'DEFAULT'>>
| $IMPORTED_TYPE$_RecoilState_1<$TEMPORARY$string<'a'>>
| $IMPORTED_TYPE$_RecoilState_1<boolean>,
value:
| boolean
| number
| string
| $TEMPORARY$string<'ERROR'>
| $TEMPORARY$string<'SET'>
| $TEMPORARY$string<'SET2'>
| $TEMPORARY$string<'b'>,
) {
function setValue<T>(recoilState: RecoilState<T>, value: T) {
setRecoilValue(store, recoilState, value);
// $FlowExpectedError[unsafe-addition]
// $FlowExpectedError[cannot-write]
store.getState().currentTree.version++;
}

function resetValue(
recoilState: $IMPORTED_TYPE$_RecoilState_1<$TEMPORARY$string<'DEFAULT'>>,
) {
function resetValue<T>(recoilState: RecoilState<T>) {
setRecoilValue(store, recoilState, new DefaultValue());
// $FlowExpectedError[unsafe-addition]
// $FlowExpectedError[cannot-write]

0 comments on commit 3c9e211

Please sign in to comment.