Skip to content

Commit e47a09d

Browse files
committed
[flow] enable enforce_local_inference_annotations
1 parent d6fc143 commit e47a09d

File tree

60 files changed

+121
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+121
-2
lines changed

packages/react-cache/src/ReactCacheOld.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ function readContext(Context: ReactContext<mixed>) {
6262
return dispatcher.readContext(Context);
6363
}
6464

65+
// $FlowFixMe[missing-local-annot]
6566
function identityHashFn(input) {
6667
if (__DEV__) {
6768
if (

packages/react-devtools-core/src/standalone.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ function onDisconnected() {
167167
disconnectedCallback();
168168
}
169169

170+
// $FlowFixMe[missing-local-annot]
170171
function onError({code, message}) {
171172
safeUnmount();
172173

packages/react-devtools-extensions/src/backend.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
let welcomeHasInitialized = false;
1010

11+
// $FlowFixMe[missing-local-annot]
1112
function welcome(event) {
1213
if (
1314
event.source !== window ||
@@ -55,6 +56,7 @@ function setup(hook: any) {
5556

5657
const bridge = new Bridge({
5758
listen(fn) {
59+
// $FlowFixMe[missing-local-annot]
5860
const listener = event => {
5961
if (
6062
event.source !== window ||

packages/react-devtools-inline/src/backend.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type {BackendBridge} from 'react-devtools-shared/src/bridge';
1010
import type {Wall} from 'react-devtools-shared/src/types';
1111

1212
function startActivation(contentWindow: any, bridge: BackendBridge) {
13+
// $FlowFixMe[missing-local-annot]
1314
const onSavedPreferences = data => {
1415
// This is the only message we're listening for,
1516
// so it's safe to cleanup after we've received it.
@@ -96,6 +97,7 @@ export function createBridge(contentWindow: any, wall?: Wall): BackendBridge {
9697
if (wall == null) {
9798
wall = {
9899
listen(fn) {
100+
// $FlowFixMe[missing-local-annot]
99101
const onMessage = ({data}) => {
100102
fn(data);
101103
};

packages/react-devtools-inline/src/frontend.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export function createBridge(contentWindow: any, wall?: Wall): FrontendBridge {
3737
if (wall == null) {
3838
wall = {
3939
listen(fn) {
40+
// $FlowFixMe[missing-local-annot]
4041
const onMessage = ({data}) => {
4142
fn(data);
4243
};

packages/react-devtools-shared/src/backend/console.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ export function patch({
197197
? targetConsole[method].__REACT_DEVTOOLS_ORIGINAL_METHOD__
198198
: targetConsole[method]);
199199

200+
// $FlowFixMe[missing-local-annot]
200201
const overrideMethod = (...args) => {
201202
let shouldAppendWarningStack = false;
202203
if (method !== 'log') {
@@ -335,6 +336,7 @@ export function patchForStrictMode() {
335336
? targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__
336337
: targetConsole[method]);
337338

339+
// $FlowFixMe[missing-local-annot]
338340
const overrideMethod = (...args) => {
339341
if (!consoleSettingsRef.hideConsoleLogsInStrictMode) {
340342
// Dim the text color of the double logs if we're not

packages/react-devtools-shared/src/devtools/ContextMenu/ContextMenu.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export default function ContextMenu({children, id}: Props): React.Node {
104104
const menu = ((menuRef.current: any): HTMLElement);
105105
const container = containerRef.current;
106106
if (container !== null) {
107+
// $FlowFixMe[missing-local-annot]
107108
const hideUnlessContains = event => {
108109
if (!menu.contains(event.target)) {
109110
hideMenu();

packages/react-devtools-shared/src/devtools/views/Components/Components.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ function Components(_: {}) {
100100
onResizeEnd = () =>
101101
dispatch({type: 'ACTION_SET_IS_RESIZING', payload: false});
102102

103+
// $FlowFixMe[missing-local-annot]
103104
onResize = event => {
104105
const resizeElement = resizeElementRef.current;
105106
const wrapperElement = wrapperElementRef.current;

packages/react-devtools-shared/src/devtools/views/Components/EditableValue.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ export default function EditableValue({
3636
externalValue: value,
3737
});
3838

39+
// $FlowFixMe[missing-local-annot]
3940
const handleChange = ({target}) =>
4041
dispatch({
4142
type: 'UPDATE',
4243
editableValue: target.value,
4344
externalValue: value,
4445
});
4546

47+
// $FlowFixMe[missing-local-annot]
4648
const handleCheckBoxToggle = ({target}) => {
4749
dispatch({
4850
type: 'UPDATE',
@@ -58,6 +60,7 @@ export default function EditableValue({
5860
overrideValue(path, target.checked);
5961
};
6062

63+
// $FlowFixMe[missing-local-annot]
6164
const handleKeyDown = event => {
6265
// Prevent keydown events from e.g. change selected element in the tree
6366
event.stopPropagation();

packages/react-devtools-shared/src/devtools/views/Components/Element.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export default function Element({data, index, style}: Props): React.Node {
7575
}
7676
};
7777

78+
// $FlowFixMe[missing-local-annot]
7879
const handleClick = ({metaKey}) => {
7980
if (id !== null) {
8081
logEvent({
@@ -99,6 +100,7 @@ export default function Element({data, index, style}: Props): React.Node {
99100
setIsHovered(false);
100101
};
101102

103+
// $FlowFixMe[missing-local-annot]
102104
const handleKeyDoubleClick = event => {
103105
// Double clicks on key value are used for text selection (if the text has been truncated).
104106
// They should not enter the owners tree view.
@@ -220,6 +222,7 @@ export default function Element({data, index, style}: Props): React.Node {
220222
}
221223

222224
// Prevent double clicks on toggle from drilling into the owner list.
225+
// $FlowFixMe[missing-local-annot]
223226
const swallowDoubleClick = event => {
224227
event.preventDefault();
225228
event.stopPropagation();
@@ -233,13 +236,15 @@ type ExpandCollapseToggleProps = {
233236
function ExpandCollapseToggle({element, store}: ExpandCollapseToggleProps) {
234237
const {children, id, isCollapsed} = element;
235238

239+
// $FlowFixMe[missing-local-annot]
236240
const toggleCollapsed = event => {
237241
event.preventDefault();
238242
event.stopPropagation();
239243

240244
store.toggleIsCollapsed(id, !isCollapsed);
241245
};
242246

247+
// $FlowFixMe[missing-local-annot]
243248
const stopPropagation = event => {
244249
// Prevent the row from selecting
245250
event.stopPropagation();

0 commit comments

Comments
 (0)