Skip to content

Commit

Permalink
Flow updated to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
leebyron committed Jul 20, 2021
1 parent 2a642f7 commit c47536d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
27 changes: 19 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "7.24.0",
"eslint-plugin-react-hooks": "4.2.0",
"flow-bin": "0.89.0",
"flow-bin": "0.155.1",
"jasmine-check": "0.1.5",
"jest": "26.6.3",
"make-synchronous": "^0.1.1",
Expand Down
2 changes: 0 additions & 2 deletions type-definitions/flow-tests/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
../../

[options]
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe
module.name_mapper='^immutable$' -> '../../type-definitions/immutable.js.flow'

[ignore]
Expand Down
5 changes: 3 additions & 2 deletions type-definitions/flow-tests/immutable-flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ numberList = List.of('a').merge(List.of(1));
// Functional API

numberList = merge(List([1]), List([2]));
numberOrStringList = merge(List(['a']), List([1]));
numberOrStringList = merge<List<string | number>>(List(['a']), List([1]));
// $FlowExpectedError[incompatible-call]
numberList = merge(List(['a']), List([1]));

Expand Down Expand Up @@ -332,6 +332,7 @@ stringToNumberOrString = Map({ a: 1 }).update('a', (value) => 'a');
stringToNumber = Map({ a: 1 }).update('a', (value) => 'a');

stringToNumberOrString = Map({ a: 1 }).update('a', 'b', (value) => 'a');
// $FlowExpectedError[incompatible-type-arg]
// $FlowExpectedError[incompatible-call]
stringToNumber = Map({ a: 1 }).update('a', 'b', (value) => 'a');
// $FlowExpectedError[incompatible-type-arg]
Expand Down Expand Up @@ -1169,8 +1170,8 @@ const friendlies: List<PersonRecord2> = List([makePersonRecord2()]);
// $FlowExpectedError[incompatible-call]
friendlies.setIn([0, 'friends', 0, 'name'], 123);
friendlies.setIn([0, 'friends', 0, 'name'], 'Sally');
// $FlowExpectedError[prop-missing]
friendlies.updateIn([0, 'friends', 0, 'name'], (value) =>
// $FlowExpectedError[prop-missing]
value.unknownFunction()
);
friendlies.updateIn([0, 'friends', 0, 'name'], (value) => value.toUpperCase());
Expand Down
1 change: 1 addition & 0 deletions type-definitions/flow-tests/record.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const originAlt2: $ReadOnly<TPointNew> = MakePointNew();

// Use of new may only return a class instance, not a record
// (supported but discouraged)
// $FlowExpectedError[class-object-subtyping]
// $FlowExpectedError[prop-missing]
const mistakeOriginNew: PointNew = new MakePointNew();
// An alternative type strategy is instance based
Expand Down

0 comments on commit c47536d

Please sign in to comment.