From 51741a27414722840c28231ff9fb550fc4ac0e69 Mon Sep 17 00:00:00 2001 From: Sam Goldman Date: Fri, 6 Jul 2018 15:57:14 -0700 Subject: [PATCH] Update Sonar from 0.69.0 to 0.70.0 Summary: All the new errors were missing annotation errors. I fixed as many as I could by adding annotations. For the rest I added a $FlowFixMe suppression type. Reviewed By: nmote Differential Revision: D8756267 fbshipit-source-id: a69b6e21525b9b12e582ff18dcb1eeea584abb2a --- .flowconfig | 4 +++- src/device-plugins/logs/index.js | 2 +- src/plugins/layout/index.js | 2 -- src/ui/components/table/TableHead.js | 4 +++- src/ui/styled/gc.js | 2 +- src/utils/icons.js | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.flowconfig b/.flowconfig index f397aa460..8b334f8e1 100644 --- a/.flowconfig +++ b/.flowconfig @@ -19,5 +19,7 @@ all=true include_warnings=true module.name_mapper='sonar' -> '/src/index.js' +suppress_type=$FlowFixMe + [version] -0.69.0 +0.70.0 diff --git a/src/device-plugins/logs/index.js b/src/device-plugins/logs/index.js index 169815300..27e79930e 100644 --- a/src/device-plugins/logs/index.js +++ b/src/device-plugins/logs/index.js @@ -486,7 +486,7 @@ export default class LogTable extends SonarDevicePlugin { createPaste(paste); }; - setTableRef = (ref: React.ElementRef<*>) => { + setTableRef = (ref: React.ElementRef) => { this.tableRef = ref; }; diff --git a/src/plugins/layout/index.js b/src/plugins/layout/index.js index a70bd3957..e420eba07 100644 --- a/src/plugins/layout/index.js +++ b/src/plugins/layout/index.js @@ -233,7 +233,6 @@ export default class Layout extends SonarPlugin { for (const element of elements) { const current = updatedElements[element.id] || {}; - // $FlowFixMe updatedElements[element.id] = { ...current, ...element, @@ -248,7 +247,6 @@ export default class Layout extends SonarPlugin { for (const element of elements) { const current = updatedElements[element.id] || {}; - // $FlowFixMe updatedElements[element.id] = { ...current, ...element, diff --git a/src/ui/components/table/TableHead.js b/src/ui/components/table/TableHead.js index c62df84a9..b0c165268 100644 --- a/src/ui/components/table/TableHead.js +++ b/src/ui/components/table/TableHead.js @@ -26,6 +26,8 @@ import FlexRow from '../FlexRow.js'; const invariant = require('invariant'); +type MenuTemplate = Array; + const TableHeaderArrow = styled.text({ float: 'right', }); @@ -198,7 +200,7 @@ export default class TableHead extends PureComponent<{ columnSizes: TableColumnSizes, onColumnResize: ?TableOnColumnResize, }> { - buildContextMenu = () => { + buildContextMenu = (): MenuTemplate => { return Object.keys(this.props.columns).map(key => { const visible = this.props.columnKeys.includes(key); return { diff --git a/src/ui/styled/gc.js b/src/ui/styled/gc.js index baa522adc..bf0160ed4 100644 --- a/src/ui/styled/gc.js +++ b/src/ui/styled/gc.js @@ -86,7 +86,7 @@ export class GarbageCollector { } } - getCollectionQueue() { + getCollectionQueue(): Array { return Array.from(this.classRemovalQueue); } diff --git a/src/utils/icons.js b/src/utils/icons.js index 9f30dbbe1..b50d5d145 100644 --- a/src/utils/icons.js +++ b/src/utils/icons.js @@ -6,7 +6,7 @@ */ // list of icons that are prefetched in the service worker when launching the app -export const precachedIcons = [ +export const precachedIcons: Array = [ { name: 'arrow-right', size: 12,