Skip to content

Commit 8d33cf4

Browse files
authored
fix: fix flow syntax issue (#117)
1 parent ec12459 commit 8d33cf4

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

.flowconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
; We fork some components by platform
33
.*/*[.]android.js
44

5+
56
; Ignore "BUCK" generated dirs
67
<PROJECT_ROOT>/\.buckd/
78

@@ -17,8 +18,9 @@ node_modules/warning/.*
1718

1819
[untyped]
1920
.*/node_modules/@react-native-community/cli/.*/.*
20-
.*/node_modules/@testing-library/react-native/build/.*
21-
.*/node_modules/react-native-testing-library/.*
21+
22+
; menu has a bunch of errors but we want to keep flow syntax in there
23+
.*/src/overflowMenu/vendor/Menu.js
2224

2325
[include]
2426

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"homepage": "https://github.com/vonovak/react-navigation-header-buttons#readme",
4040
"devDependencies": {
4141
"@react-native-community/eslint-config": "^2.0.0",
42-
"@testing-library/react-native": "^7.0.1",
42+
"@testing-library/react-native": "^7.2.0",
4343
"eslint": "^7.11.0",
4444
"eslint-plugin-prettier": "^3.1.2",
4545
"flow-bin": "^0.137.0",

src/overflowMenu/vendor/Menu.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// @flow
2+
// menu has a bunch of errors so typecheck is ignored but we want to keep flow syntax in here
3+
14
import * as React from 'react';
25
import {
36
Platform,
@@ -167,9 +170,7 @@ export class Menu extends React.Component<Props, State> {
167170
isAnchorCoord = () => !React.isValidElement(this.props.anchor);
168171

169172
measureMenuLayout = () =>
170-
new Promise() <
171-
LayoutRectangle >
172-
((resolve) => {
173+
new Promise<LayoutRectangle>((resolve) => {
173174
if (this.menu) {
174175
// $FlowFixMe
175176
this.menu.measureInWindow((x, y, width, height) => {
@@ -179,9 +180,7 @@ export class Menu extends React.Component<Props, State> {
179180
});
180181

181182
measureAnchorLayout = () =>
182-
new Promise() <
183-
LayoutRectangle >
184-
((resolve) => {
183+
new Promise<LayoutRectangle>((resolve) => {
185184
const { anchor } = this.props;
186185
if (this.isAnchorCoord()) {
187186
// $FlowFixMe

yarn.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,10 +1263,10 @@
12631263
dependencies:
12641264
"@sinonjs/commons" "^1.7.0"
12651265

1266-
"@testing-library/react-native@^7.0.1":
1267-
version "7.0.2"
1268-
resolved "https://registry.yarnpkg.com/@testing-library/react-native/-/react-native-7.0.2.tgz#fd00b4c5639f606a07b20d0fec5a4cbfc3851efa"
1269-
integrity sha512-mOnsEgdbIvXa2cpZz+DTWiqtgObHRICujBGVXHVc1Wr9HbD7mMXIVPiOaUZPL6Wufw23FTy1pqAUIuQydtBc1Q==
1266+
"@testing-library/react-native@^7.2.0":
1267+
version "7.2.0"
1268+
resolved "https://registry.yarnpkg.com/@testing-library/react-native/-/react-native-7.2.0.tgz#e5ec5b0974e4e5f525f8057563417d1e9f820d96"
1269+
integrity sha512-rDKzJjAAeGgyoJT0gFQiMsIL09chdWcwZyYx6WZHMgm2c5NDqY52hUuyTkzhqddMYWmSRklFphSg7B2HX+246Q==
12701270
dependencies:
12711271
pretty-format "^26.0.1"
12721272

@@ -2723,9 +2723,9 @@ [email protected]:
27232723
prettier-linter-helpers "^1.0.0"
27242724

27252725
eslint-plugin-prettier@^3.1.2:
2726-
version "3.1.4"
2727-
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz#168ab43154e2ea57db992a2cd097c828171f75c2"
2728-
integrity sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==
2726+
version "3.3.1"
2727+
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz#7079cfa2497078905011e6f82e8dd8453d1371b7"
2728+
integrity sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ==
27292729
dependencies:
27302730
prettier-linter-helpers "^1.0.0"
27312731

@@ -5660,9 +5660,9 @@ prettier@^2.0.2:
56605660
integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==
56615661

56625662
prettier@^2.1.2:
5663-
version "2.1.2"
5664-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5"
5665-
integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==
5663+
version "2.2.1"
5664+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
5665+
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
56665666

56675667
pretty-format@^24.7.0, pretty-format@^24.9.0:
56685668
version "24.9.0"

0 commit comments

Comments
 (0)