diff --git a/src/Client.tsx b/src/Client.tsx index 42f5e3bb0..0d90dfc23 100644 --- a/src/Client.tsx +++ b/src/Client.tsx @@ -367,7 +367,6 @@ export default class Client extends EventEmitter { this.store.getState().plugins.devicePlugins.get(params.api); if (persistingPlugin && persistingPlugin.persistedStateReducer) { let pluginKey = `${this.id}#${params.api}`; - //$FlowFixMe if (persistingPlugin.prototype instanceof FlipperDevicePlugin) { // For device plugins, we are just using the device id instead of client id as the prefix. this.deviceSerial().then( diff --git a/src/MenuBar.tsx b/src/MenuBar.tsx index f29a0ae96..a906af187 100644 --- a/src/MenuBar.tsx +++ b/src/MenuBar.tsx @@ -98,7 +98,6 @@ export function setupMenuBar( menuItem => menuItem.label === topLevelMenu, ); if (menu) { - // $FlowFixMe submenu is missing in electron API spec const menuItem = menu.submenu.items.find( menuItem => menuItem.label === label, ); diff --git a/src/__tests__/createTablePlugin.node.tsx b/src/__tests__/createTablePlugin.node.tsx index f33eb22e4..ded44e802 100644 --- a/src/__tests__/createTablePlugin.node.tsx +++ b/src/__tests__/createTablePlugin.node.tsx @@ -64,7 +64,6 @@ test('persistedStateReducer is adding data', () => { const tablePlugin = createTablePlugin({...PROPS, method}); const id = '1'; - // $FlowFixMe persistedStateReducer exists for createTablePlugin const {rows, datas} = tablePlugin.persistedStateReducer( tablePlugin.defaultPersistedState, method, diff --git a/src/dispatcher/plugins.tsx b/src/dispatcher/plugins.tsx index 4298a3f2e..89854e848 100644 --- a/src/dispatcher/plugins.tsx +++ b/src/dispatcher/plugins.tsx @@ -107,7 +107,6 @@ export function getDynamicPlugins() { let dynamicPlugins: Array = []; try { dynamicPlugins = JSON.parse( - // $FlowFixMe process.env not defined in electron API spec (remote && remote.process.env.PLUGINS) || process.env.PLUGINS || '[]', ); } catch (e) { diff --git a/src/dispatcher/tracking.tsx b/src/dispatcher/tracking.tsx index e895e2bfc..145e7ab34 100644 --- a/src/dispatcher/tracking.tsx +++ b/src/dispatcher/tracking.tsx @@ -6,7 +6,6 @@ */ import {ipcRenderer} from 'electron'; -// $FlowFixMe perf_hooks is a new API in node import {performance} from 'perf_hooks'; import {Store} from '../reducers/index'; diff --git a/src/plugin.tsx b/src/plugin.tsx index f5b4ee9ef..eb9b0650e 100644 --- a/src/plugin.tsx +++ b/src/plugin.tsx @@ -157,17 +157,14 @@ export abstract class FlipperBasePlugin< _teardown(): void {} dispatchAction(actionData: Actions) { - // $FlowFixMe const action = this.reducers[actionData.type]; if (!action) { - // $FlowFixMe throw new ReferenceError(`Unknown action ${actionData.type}`); } if (typeof action === 'function') { this.setState(action.call(this, this.state, actionData) as State); } else { - // $FlowFixMe throw new TypeError(`Reducer ${actionData.type} isn't a function`); } } diff --git a/src/reducers/plugins.tsx b/src/reducers/plugins.tsx index 771c28720..eaf52bef5 100644 --- a/src/reducers/plugins.tsx +++ b/src/reducers/plugins.tsx @@ -63,7 +63,6 @@ export default function reducer( return; } - // $FlowFixMe Flow doesn't know prototype if (p.prototype instanceof FlipperDevicePlugin) { // @ts-ignore doesn't know p must be typeof FlipperDevicePlugin here devicePlugins.set(p.id, p); diff --git a/src/ui/components/Orderable.tsx b/src/ui/components/Orderable.tsx index 7fe21a324..3ca8b72b6 100644 --- a/src/ui/components/Orderable.tsx +++ b/src/ui/components/Orderable.tsx @@ -202,13 +202,11 @@ export default class Orderable extends React.Component< {passive: true}, ); - // $FlowFixMe const screenClickPos = event.nativeEvent[this.screenKey]; document.addEventListener( 'mousemove', (this._mousemove = (event: MouseEvent) => { - // $FlowFixMe const goingOpposite = event[this.screenKey] < screenClickPos; this.possibleMove(activeKey, goingOpposite, event, clickOffset, sizes); }), @@ -230,7 +228,7 @@ export default class Orderable extends React.Component< if (containerRef) { const containerRect: Rect = containerRef.getBoundingClientRect(); - let newActivePos = // $FlowFixMe + let newActivePos = event[this.screenKey] - containerRect[this.offsetKey] - cursorOffset; newActivePos = Math.max(-1, newActivePos); newActivePos = Math.min( diff --git a/src/ui/components/table/ManagedTable_immutable.tsx b/src/ui/components/table/ManagedTable_immutable.tsx index b958bacea..560c7e3b0 100644 --- a/src/ui/components/table/ManagedTable_immutable.tsx +++ b/src/ui/components/table/ManagedTable_immutable.tsx @@ -322,7 +322,6 @@ class ManagedTable extends React.Component< if (!e.shiftKey) { highlightedRows.clear(); } - // $FlowFixMe 0 <= newIndex <= rows.size - 1 highlightedRows.add(rows.get(newIndex)!.key); this.onRowHighlighted(highlightedRows, () => { const {current} = this.tableRef; @@ -437,11 +436,9 @@ class ManagedTable extends React.Component< let startIndex = -1; let endIndex = -1; for (let i = 0; i < this.props.rows.size; i++) { - // $FlowFixMe 0 <= newIndex <= rows.size - 1 if (this.props.rows.get(i)!.key === fromKey) { startIndex = i; } - // $FlowFixMe 0 <= newIndex <= rows.size - 1 if (this.props.rows.get(i)!.key === toKey) { endIndex = i; } @@ -456,7 +453,6 @@ class ManagedTable extends React.Component< i++ ) { try { - // $FlowFixMe 0 <= newIndex <= rows.size - 1 selected.push(this.props.rows.get(i)!.key); } catch (e) {} } @@ -475,7 +471,6 @@ class ManagedTable extends React.Component< !e.shiftKey // When shift key is pressed, it's a range select not a drag select ) { current.scrollToItem(index + 1); - // $FlowFixMe 0 <= newIndex <= rows.size - 1 const startKey = this.props.rows.get(dragStartIndex)!.key; const highlightedRows = new Set(this.selectInRange(startKey, row.key)); this.onRowHighlighted(highlightedRows); diff --git a/src/utils/isProduction.tsx b/src/utils/isProduction.tsx index 3eefeaa9f..fa73dbb74 100644 --- a/src/utils/isProduction.tsx +++ b/src/utils/isProduction.tsx @@ -8,7 +8,6 @@ import electron from 'electron'; const _isProduction = !/node_modules[\\/]electron[\\/]/.test( - // $FlowFixMe: execPath exists, but is not in electron API spec process.execPath || electron.remote.process.execPath, ); diff --git a/types/globals.tsx b/types/globals.tsx index 1253ffc75..e84a631e3 100644 --- a/types/globals.tsx +++ b/types/globals.tsx @@ -12,8 +12,14 @@ export {}; type RequestIdleHandle = number; declare global { + interface StoreEnhancerStateSanitizer { + stateSanitizer: Function; + } + interface Window { - __REDUX_DEVTOOLS_EXTENSION__: undefined | StoreEnhancerStoreCreator; + __REDUX_DEVTOOLS_EXTENSION__: + | undefined + | StoreEnhancerStoreCreator & StoreEnhancerStateSanitizer; Flipper: { init: () => void;