Update flow to 0.59 and fix some flow issues (#6957)

This commit is contained in:
Daniel Tschinder 2017-12-02 14:59:46 +01:00 committed by Henry Zhu
parent 607916880d
commit de5ab72c49
5 changed files with 8 additions and 9 deletions

View File

@ -17,6 +17,7 @@ lib/types.js
lib/third-party-libs.js.flow lib/third-party-libs.js.flow
[options] [options]
include_warnings=true
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
suppress_comment= \\(.\\|\n\\)*\\$FlowIssue suppress_comment= \\(.\\|\n\\)*\\$FlowIssue
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore

View File

@ -31,7 +31,7 @@
"eslint-config-babel": "^7.0.2", "eslint-config-babel": "^7.0.2",
"eslint-plugin-flowtype": "^2.20.0", "eslint-plugin-flowtype": "^2.20.0",
"eslint-plugin-prettier": "^2.2.0", "eslint-plugin-prettier": "^2.2.0",
"flow-bin": "^0.57.3", "flow-bin": "^0.59.0",
"graceful-fs": "^4.1.11", "graceful-fs": "^4.1.11",
"gulp": "^3.9.0", "gulp": "^3.9.0",
"gulp-babel": "^8.0.0-beta.0", "gulp-babel": "^8.0.0-beta.0",

View File

@ -1513,10 +1513,9 @@ export default class StatementParser extends ExpressionParser {
} }
} }
checkDeclaration(node: N.Pattern): void { checkDeclaration(node: N.Pattern | N.ObjectProperty): void {
if (node.type === "ObjectPattern") { if (node.type === "ObjectPattern") {
for (const prop of node.properties) { for (const prop of node.properties) {
// $FlowFixMe (prop may be an AssignmentProperty, in which case this does nothing?)
this.checkDeclaration(prop); this.checkDeclaration(prop);
} }
} else if (node.type === "ArrayPattern") { } else if (node.type === "ArrayPattern") {

View File

@ -74,10 +74,9 @@ export default (superClass: Class<Parser>): Class<Parser> =>
node.expression = false; node.expression = false;
} }
checkDeclaration(node: N.Pattern): void { checkDeclaration(node: N.Pattern | N.ObjectProperty): void {
if (isSimpleProperty(node)) { if (isSimpleProperty(node)) {
// $FlowFixMe this.checkDeclaration(((node: any): N.EstreeProperty).value);
this.checkDeclaration(node.value);
} else { } else {
super.checkDeclaration(node); super.checkDeclaration(node);
} }

View File

@ -2743,9 +2743,9 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2" graceful-fs "^4.1.2"
write "^0.2.1" write "^0.2.1"
flow-bin@^0.57.3: flow-bin@^0.59.0:
version "0.57.3" version "0.59.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.57.3.tgz#843fb80a821b6d0c5847f7bb3f42365ffe53b27b" resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.59.0.tgz#8c151ee7f09f1deed9bf0b9d1f2e8ab9d470f1bb"
for-in@^1.0.1: for-in@^1.0.1:
version "1.0.2" version "1.0.2"