Skip to content

Commit 169d2f1

Browse files
authored
v3.8.1 #43
2 parents fa1acec + 1ecc044 commit 169d2f1

22 files changed

+3411
-2616
lines changed

.babelrc

-3
This file was deleted.

.eslintrc

-136
This file was deleted.

.eslintrc.js

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
const OFF = 0;
2+
const WARNING = 1;
3+
const ERROR = 2;
4+
5+
module.exports = {
6+
extends: [
7+
'airbnb',
8+
'plugin:flowtype/recommended',
9+
'plugin:jest/recommended',
10+
'prettier',
11+
'prettier/flowtype',
12+
'prettier/react',
13+
],
14+
env: {
15+
browser: true,
16+
node: true,
17+
es6: true,
18+
jest: true,
19+
},
20+
parser: 'babel-eslint',
21+
plugins: ['flowtype', 'jest', 'prettier', 'react-native'],
22+
rules: {
23+
'global-require': OFF,
24+
'import/no-extraneous-dependencies': OFF,
25+
'import/no-named-as-default': OFF,
26+
'react/destructuring-assignment': OFF,
27+
'react/sort-comp': OFF,
28+
'react/jsx-filename-extension': [OFF, { extensions: ['.js'] }],
29+
'react/forbid-prop-types': [ERROR, { forbid: ['any'] }],
30+
'react/no-unescaped-entities': [Error, { forbid: ['>', '}'] }],
31+
'react/require-default-props': WARNING,
32+
'no-unused-expressions': OFF,
33+
'no-use-before-define': OFF,
34+
'prettier/prettier': [
35+
'error',
36+
{
37+
semi: true,
38+
singleQuote: true,
39+
trailingComma: 'es5',
40+
proseWrap: 'always',
41+
tabWidth: 2,
42+
printWidth: 80,
43+
},
44+
],
45+
},
46+
};

.flowconfig

+34-17
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
; We fork some components by platform
33
.*/*[.]android.js
44

5-
; Ignore templates for 'react-native init'
6-
.*/local-cli/templates/.*
7-
8-
; Ignore the website subdir
9-
<PROJECT_ROOT>/website/.*
10-
115
; Ignore "BUCK" generated dirs
126
<PROJECT_ROOT>/\.buckd/
137

@@ -18,36 +12,59 @@
1812
; For RN Apps installed via npm, "Libraries" folder is inside
1913
; "node_modules/react-native" but in the source repo it is in the root
2014
.*/Libraries/react-native/React.js
21-
.*/Libraries/react-native/ReactNative.js
2215

23-
; Ignore libraries with broken flow
24-
.*/node_modules/react-native/.*
25-
.*/node_modules/styled-components/.*
26-
.*/node_modules/metro-bundler/.*
16+
; Ignore polyfills
17+
.*/Libraries/polyfills/.*
18+
19+
; Ignore metro
20+
.*/node_modules/metro/.*
2721

2822
[include]
2923

3024
[libs]
3125
node_modules/react-native/Libraries/react-native/react-native-interface.js
3226
node_modules/react-native/flow/
27+
node_modules/react-native/flow-github/
3328

3429
[options]
30+
emoji=true
31+
32+
esproposal.optional_chaining=enable
33+
esproposal.nullish_coalescing=enable
34+
3535
module.system=haste
36+
module.system.haste.use_name_reducers=true
37+
# get basename
38+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
39+
# strip .js or .js.flow suffix
40+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
41+
# strip .ios suffix
42+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
43+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
44+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
45+
module.system.haste.paths.blacklist=.*/__tests__/.*
46+
module.system.haste.paths.blacklist=.*/__mocks__/.*
47+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
48+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
3649

3750
munge_underscores=true
3851

39-
module.name_mapper='^react-native$' -> 'emptyObject'
40-
module.name_mapper='^styled-components$' -> 'emptyObject'
41-
4252
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'
4353

54+
module.file_ext=.js
55+
module.file_ext=.jsx
56+
module.file_ext=.json
57+
module.file_ext=.native.js
58+
4459
suppress_type=$FlowIssue
4560
suppress_type=$FlowFixMe
46-
suppress_type=$FixMe
61+
suppress_type=$FlowFixMeProps
62+
suppress_type=$FlowFixMeState
4763

48-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-6]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
49-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-6]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
64+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
65+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
5066
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
67+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
5168

5269
[version]
5370
^0.79.1

.prettierrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"printWidth": 80,
33
"singleQuote": true,
4-
"trailingComma": "es5"
4+
"trailingComma": "es5",
5+
"tabWidth": 2
56
}

.travis.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
language: node_js
2-
cache: yarn
32
node_js:
4-
- 8.12.0
3+
- stable
4+
5+
cache:
6+
yarn: true
7+
directories:
8+
- node_modules
59

610
install:
11+
- yarn global add codecov
712
- yarn
813

914
script:
10-
- yarn run ci
15+
- yarn run flow && yarn run lint && yarn run test --runInBand
16+
- codecov

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['module:metro-react-native-babel-preset'],
3+
};

0 commit comments

Comments
 (0)