diff --git a/.flowconfig b/.flowconfig index 5eab36ed0..1c7a952f4 100644 --- a/.flowconfig +++ b/.flowconfig @@ -19,6 +19,7 @@ module.system=node suppress_type=$FlowIssue suppress_type=$FlowFixMe +suppress_type=$FlowFixMeEmpty suppress_type=$FlowOSSFixMe module.name_mapper='React' -> '/node_modules/react' diff --git a/packages/recoil/caches/Recoil_TreeCache.js b/packages/recoil/caches/Recoil_TreeCache.js index 406eb0c0e..c3a2635fd 100644 --- a/packages/recoil/caches/Recoil_TreeCache.js +++ b/packages/recoil/caches/Recoil_TreeCache.js @@ -231,7 +231,7 @@ class TreeCache { 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. ' + diff --git a/packages/recoil/recoil_values/__tests__/Recoil_selector-test.js b/packages/recoil/recoil_values/__tests__/Recoil_selector-test.js index 4f465d543..dec2151bb 100644 --- a/packages/recoil/recoil_values/__tests__/Recoil_selector-test.js +++ b/packages/recoil/recoil_values/__tests__/Recoil_selector-test.js @@ -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 - | $IMPORTED_TYPE$_RecoilState_1 - | $IMPORTED_TYPE$_RecoilState_1<$FlowFixMeEmpty> - | $IMPORTED_TYPE$_RecoilState_1 - | $IMPORTED_TYPE$_RecoilState_1<$TEMPORARY$string<'DEFAULT'>> - | $IMPORTED_TYPE$_RecoilState_1<$TEMPORARY$string<'a'>> - | $IMPORTED_TYPE$_RecoilState_1, - value: - | boolean - | number - | string - | $TEMPORARY$string<'ERROR'> - | $TEMPORARY$string<'SET'> - | $TEMPORARY$string<'SET2'> - | $TEMPORARY$string<'b'>, -) { +function setValue(recoilState: RecoilState, 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(recoilState: RecoilState) { setRecoilValue(store, recoilState, new DefaultValue()); // $FlowExpectedError[unsafe-addition] // $FlowExpectedError[cannot-write]