Skip to content

Commit 732d629

Browse files
committed
build: re-added flow type checking for example app
1 parent 88ae76a commit 732d629

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

Example/.flowconfig

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
10+
11+
; Ignore duplicate module providers
12+
; For RN Apps installed via npm, "Libraries" folder is inside
13+
; "node_modules/react-native" but in the source repo it is in the root
14+
.*/Libraries/react-native/React.js
15+
16+
; Ignore polyfills
17+
.*/Libraries/polyfills/.*
18+
19+
; Ignore metro
20+
.*/node_modules/metro/.*
21+
22+
; Ignore the compiled files
23+
lib/.*
24+
25+
[include]
26+
27+
[libs]
28+
node_modules/react-native/Libraries/react-native/react-native-interface.js
29+
node_modules/react-native/flow/
30+
31+
[options]
32+
emoji=true
33+
34+
esproposal.optional_chaining=enable
35+
esproposal.nullish_coalescing=enable
36+
37+
module.system=haste
38+
module.system.haste.use_name_reducers=true
39+
# get basename
40+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
41+
# strip .js or .js.flow suffix
42+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
43+
# strip .ios suffix
44+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
45+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
46+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
47+
module.system.haste.paths.blacklist=.*/__tests__/.*
48+
module.system.haste.paths.blacklist=.*/__mocks__/.*
49+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
50+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
51+
52+
munge_underscores=true
53+
54+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
55+
# Support the library import in examples
56+
module.name_mapper='^\@react-native-community/geolocation$' -> '<PROJECT_ROOT>/js/index.js'
57+
58+
module.file_ext=.js
59+
module.file_ext=.jsx
60+
module.file_ext=.json
61+
module.file_ext=.native.js
62+
63+
suppress_type=$FlowIssue
64+
suppress_type=$FlowFixMe
65+
suppress_type=$FlowFixMeProps
66+
suppress_type=$FlowFixMeState
67+
68+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
69+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
70+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
71+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

Example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"@react-native-community/viewpager": "^1.1.7",
2020
"@react-navigation/core": "^3.4.2",
2121
"@react-navigation/native": "^3.5.0",
22+
"flow-bin": "^0.106.2",
2223
"react": "16.8.3",
2324
"react-native": "0.59.9",
2425
"react-native-fast-image": "^6.0.3",

0 commit comments

Comments
 (0)