From 207a2fd8125cb2d80dc69c23311880864fc775d7 Mon Sep 17 00:00:00 2001 From: Sam Goldman Date: Fri, 16 Mar 2018 11:42:23 -0700 Subject: [PATCH] Update to Flow v0.68 Summary: This version of Flow erorrs on unknown properties. I extended the error suppression comment to support versioned suppressions, since this is only an error after 0.68. Test Plan: flow Reviewers: leeb Subscribers: Tasks: Tags: --- .flowconfig | 4 +++- package.json | 2 +- src/error/locatedError.js | 1 + src/subscription/mapAsyncIterator.js | 2 ++ yarn.lock | 6 +++--- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.flowconfig b/.flowconfig index 740d1d1524..be3c2805df 100644 --- a/.flowconfig +++ b/.flowconfig @@ -9,6 +9,8 @@ [libs] [options] +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)?)\\)?:? #[0-9]+ [version] -^0.66.0 +^0.68.0 diff --git a/package.json b/package.json index e7c19f7049..5acce5245e 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "eslint-plugin-babel": "4.1.2", "eslint-plugin-flowtype": "2.42.0", "eslint-plugin-prettier": "2.6.0", - "flow-bin": "0.66.0", + "flow-bin": "0.68.0", "isparta": "4.0.0", "mocha": "5.0.0", "prettier": "1.10.2", diff --git a/src/error/locatedError.js b/src/error/locatedError.js index 05b83100d2..8e7adf4b1f 100644 --- a/src/error/locatedError.js +++ b/src/error/locatedError.js @@ -22,6 +22,7 @@ export function locatedError( ): GraphQLError { // Note: this uses a brand-check to support GraphQL errors originating from // other contexts. + // $FlowFixMe(>=0.68.0) if (originalError && Array.isArray(originalError.path)) { return (originalError: any); } diff --git a/src/subscription/mapAsyncIterator.js b/src/subscription/mapAsyncIterator.js index 0c2015abca..c7a7e23ce2 100644 --- a/src/subscription/mapAsyncIterator.js +++ b/src/subscription/mapAsyncIterator.js @@ -22,6 +22,7 @@ export default function mapAsyncIterator( const iterator = getAsyncIterator(iterable); let $return; let abruptClose; + // $FlowFixMe(>=0.68.0) if (typeof iterator.return === 'function') { $return = iterator.return; abruptClose = error => { @@ -56,6 +57,7 @@ export default function mapAsyncIterator( : Promise.resolve({ value: undefined, done: true }); }, throw(error) { + // $FlowFixMe(>=0.68.0) if (typeof iterator.throw === 'function') { return iterator.throw(error).then(mapResult, mapReject); } diff --git a/yarn.lock b/yarn.lock index cc743684d5..52f6a1e6d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1390,9 +1390,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@0.66.0: - version "0.66.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.66.0.tgz#a96dde7015dc3343fd552a7b4963c02be705ca26" +flow-bin@0.68.0: + version "0.68.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.68.0.tgz#86c2d14857d306eb2e85e274f2eebf543564f623" for-in@^1.0.1: version "1.0.2"