Skip to content

Commit 3e0e505

Browse files
JABvzlalucianomlima
authored andcommitted
Add flow (#10)
* Add flow * Solver Mege conflict * Fix merge * Fix merge closes #2
1 parent c556d6e commit 3e0e505

File tree

4 files changed

+75
-1
lines changed

4 files changed

+75
-1
lines changed

.flowconfig

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
[untyped]
23+
.*/node_modules/react-native
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+
node_modules/react-native/flow-github/
31+
32+
[options]
33+
emoji=true
34+
35+
esproposal.optional_chaining=enable
36+
esproposal.nullish_coalescing=enable
37+
38+
module.system=haste
39+
module.system.haste.use_name_reducers=true
40+
# get basename
41+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
42+
# strip .js or .js.flow suffix
43+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
44+
# strip .ios suffix
45+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
46+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
47+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
48+
module.system.haste.paths.blacklist=.*/__tests__/.*
49+
module.system.haste.paths.blacklist=.*/__mocks__/.*
50+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
51+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
52+
53+
munge_underscores=true
54+
55+
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'
56+
57+
module.file_ext=.js
58+
module.file_ext=.jsx
59+
module.file_ext=.json
60+
module.file_ext=.native.js
61+
62+
suppress_type=$FlowIssue
63+
suppress_type=$FlowFixMe
64+
suppress_type=$FlowFixMeProps
65+
suppress_type=$FlowFixMeState
66+
67+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
68+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
69+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
70+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ To inject custom scripts and remove unnecessary files.
2929
- [x] ESlint (extends Airbnb) v4.19.1
3030
- [x] Lint Staged v7.3.0
3131
- [x] Prettier v1.14.3
32+
- [x] Flow v0.84.0
3233

3334
### Custom Scripts
3435

@@ -48,7 +49,6 @@ To inject custom scripts and remove unnecessary files.
4849

4950
### Roadmap
5051

51-
- [ ] Add Flow
5252
- [ ] Add Enzyme
5353
- [ ] Add Husky
5454

devDependencies.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"eslint-plugin-prettier": "3.0.0",
1212
"eslint-plugin-react": "7.11.1",
1313
"eslint-plugin-react-native": "3.5.0",
14+
"flow-bin": "0.84.0",
1415
"lint-staged": "7.3.0",
1516
"prettier": "1.14.3"
1617
}

src/App/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//@flow
2+
13
/**
24
* React Native Basic App
35
* https://github.com/facebook/react-native
@@ -48,6 +50,7 @@ const App = (
4850
<Text style={styles.feature}>{'\u2705 ESLint'}</Text>
4951
<Text style={styles.feature}>{'\u2705 Prettier'}</Text>
5052
<Text style={styles.feature}>{'\u2705 Lint Staged'}</Text>
53+
<Text style={styles.feature}>{'\u2705 Flow'}</Text>
5154
<Text style={styles.feature}>{'\u2705 Custom Scripts'}</Text>
5255
</View>
5356
<Text style={styles.instructions}>To get started, edit App.js</Text>

0 commit comments

Comments
 (0)