Skip to content

Commit 7314fb0

Browse files
authored
Chore: Upgrade src dependencies (#123)
* Chore: Upgarde src dependencies * Flow fixes * Eslint final fixes * Bump * Update .flowconfig Added max_workers to make CI happy * Remove jest preset react-native * Update config.yml * Lint example files as well * Fixed RowItem crash when no title
1 parent 185b3d2 commit 7314fb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+3511
-1775
lines changed

.babelrc

-3
This file was deleted.

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
at: ~/react-native-ios-kit
7474
- run: yarn run lint
7575
- run: yarn run flow
76-
- run: yarn test -- --coverage -i
76+
- run: yarn test --coverage -i
7777
- store_artifacts:
7878
path: coverage
7979
deploy-website:
@@ -111,7 +111,7 @@ jobs:
111111
workflows:
112112
version: 2
113113

114-
website:
114+
build-and-test:
115115
jobs:
116116
- install-dependencies
117117
- tests:

.editorconfig

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
# top-most EditorConfig file
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
25
root = true
36

4-
# Unix-style newlines with a newline ending every file
7+
58
[*]
6-
end_of_line = lf
7-
insert_final_newline = true
89

9-
# Indentation override for all JS under lib directory
10-
[*/**.js]
11-
charset = utf-8
10+
# change these settings to your own preference
1211
indent_style = space
1312
indent_size = 2
1413

15-
# Matches the exact files either package.json or .travis.yml
16-
[*.json]
17-
indent_style = space
18-
indent_size = 2
14+
# we recommend you to keep these unchanged
15+
end_of_line = lf
16+
charset = utf-8
17+
trim_trailing_whitespace = true
18+
insert_final_newline = true
19+
20+
[*.md]
21+
trim_trailing_whitespace = false

.eslintcache

+1
Large diffs are not rendered by default.

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
22
flow-typed/
33
dist/
4+
website/

.eslintrc

+11-128
Original file line numberDiff line numberDiff line change
@@ -1,148 +1,31 @@
11
{
2-
"parser": "babel-eslint",
3-
42
"env": {
5-
"browser": true,
6-
"node": true,
7-
"es6": true
8-
},
9-
10-
"parserOptions": {
11-
"sourceType": "module",
12-
"ecmaFeatures": {
13-
"jsx": true
14-
}
3+
"browser": true
154
},
165

17-
"extends": ["prettier", "prettier/flowtype", "prettier/react"],
6+
"extends": ["callstack-io"],
187

19-
"plugins": [
20-
"babel",
21-
"flowtype",
22-
"import",
23-
"react",
24-
"react-native",
25-
"prettier"
26-
],
8+
"plugins": ["react-native"],
279

2810
"rules": {
29-
"constructor-super": "error",
30-
"no-case-declarations": "error",
31-
"no-class-assign": "error",
32-
"no-cond-assign": "error",
33-
"no-const-assign": "error",
34-
"no-constant-condition": "error",
35-
"no-control-regex": "error",
36-
"no-delete-var": "error",
37-
"no-dupe-args": "error",
38-
"no-dupe-class-members": "error",
39-
"no-dupe-keys": "error",
40-
"no-duplicate-case": "error",
41-
"no-empty": "error",
42-
"no-empty-character-class": "error",
43-
"no-empty-pattern": "error",
44-
"no-ex-assign": "error",
45-
"no-extra-boolean-cast": "error",
46-
"no-extra-semi": "error",
47-
"no-fallthrough": "error",
48-
"no-func-assign": "error",
49-
"no-global-assign": "error",
50-
"no-inner-declarations": "error",
51-
"no-invalid-regexp": "error",
52-
"no-new-symbol": "error",
53-
"no-obj-calls": "error",
54-
"no-octal": "error",
55-
"no-redeclare": "error",
56-
"no-regex-spaces": "error",
57-
"no-self-assign": "error",
58-
"no-sparse-arrays": "error",
59-
"no-this-before-super": "error",
60-
"no-undef": "error",
61-
"no-unexpected-multiline": "error",
62-
"no-unreachable": "error",
63-
"no-unsafe-finally": "error",
64-
"no-unsafe-negation": "error",
65-
"no-unused-labels": "error",
66-
"no-unused-vars": "error",
67-
"require-yield": "error",
68-
"use-isnan": "error",
69-
"valid-typeof": "error",
70-
71-
"babel/new-cap": "off",
72-
"babel/object-curly-spacing": "off",
73-
"babel/arrow-parens": "off",
11+
"one-var": "off",
12+
"no-multi-assign": "off",
13+
"no-nested-ternary": "off",
14+
"global-require": "off",
7415

75-
"flowtype/boolean-style": ["error", "boolean"],
7616
"flowtype/define-flow-type": "error",
77-
"flowtype/no-dupe-keys": "error",
78-
"flowtype/no-primitive-constructor-types": "error",
7917
"flowtype/no-weak-types": "off",
80-
"flowtype/require-parameter-type": "off",
81-
"flowtype/require-return-type": "off",
82-
"flowtype/require-valid-file-annotation": "error",
8318
"flowtype/require-variable-type": "off",
8419
"flowtype/sort-keys": "off",
8520
"flowtype/type-id-match": "off",
8621
"flowtype/use-flow-type": "error",
8722
"flowtype/valid-syntax": "error",
8823

89-
"import/no-unresolved": "error",
90-
"import/named": "error",
91-
"import/default": "off",
92-
"import/namespace": "off",
93-
"import/export": "error",
94-
"import/no-named-as-default": "off",
95-
"import/no-named-as-default-member": "off",
96-
"import/no-deprecated": "off",
9724
"import/no-extraneous-dependencies": "off",
98-
"import/no-commonjs": "error",
99-
"import/no-amd": "error",
100-
"import/no-nodejs-modules": "off",
101-
"import/imports-first": "error",
102-
"import/no-duplicates": "error",
103-
"import/no-namespace": "off",
104-
"import/extensions": ["error", { "js": "never", "json": "always" }],
105-
"import/order": "off",
106-
107-
"react/display-name": "off",
108-
"react/forbid-prop-types": "off",
109-
"react/no-danger": "error",
110-
"react/no-deprecated": "error",
111-
"react/no-did-mount-set-state": "error",
112-
"react/no-did-update-set-state": "error",
113-
"react/no-direct-mutation-state": "error",
114-
"react/no-is-mounted": "error",
115-
"react/no-multi-comp": "off",
116-
"react/no-set-state": "off",
117-
"react/no-string-refs": "error",
118-
"react/no-unknown-property": "error",
119-
"react/prefer-es6-class": "error",
120-
"react/prop-types": "error",
121-
"react/react-in-jsx-scope": "error",
122-
"react/require-render-return": "error",
123-
"react/self-closing-comp": "error",
124-
"react/sort-comp": "error",
125-
"react/sort-prop-types": "off",
126-
"react/jsx-boolean-value": ["error", "never"],
127-
"react/jsx-handler-names": "off",
128-
"react/jsx-key": "error",
129-
"react/jsx-no-bind": "off",
130-
"react/jsx-no-duplicate-props": "error",
131-
"react/jsx-no-literals": "off",
132-
"react/jsx-no-undef": "error",
133-
"react/jsx-pascal-case": "off",
134-
"react/jsx-sort-props": "off",
135-
"react/jsx-uses-react": "error",
136-
"react/jsx-uses-vars": "error",
137-
138-
"react-native/no-unused-styles": "error",
139-
"react-native/split-platform-components": "off",
140-
141-
"prettier/prettier": [
142-
"error",
143-
{ "trailingComma": "es5", "singleQuote": true }
144-
],
25+
"import/first": "off",
14526

146-
"jsx-a11y/href-no-hash": "off"
27+
"react-native/no-unused-styles": "off",
28+
"react/no-unused-prop-types": "off",
29+
"react-native/split-platform-components": "off"
14730
}
14831
}

.flowconfig

+46-17
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,81 @@
1212
; For RN Apps installed via npm, "Libraries" folder is inside
1313
; "node_modules/react-native" but in the source repo it is in the root
1414
.*/Libraries/react-native/React.js
15-
.*/Libraries/react-native/ReactNative.js
1615

1716
; Ignore polyfills
1817
.*/Libraries/polyfills/.*
1918

20-
; Ignore duplicate modules under example/
21-
<PROJECT_ROOT>/example/node_modules/*
19+
; Ignore metro
20+
.*/node_modules/metro/.*
2221

23-
; Ignore duplicate modules under website/
24-
.*/website/node_modules/fbjs/.*
25-
.*/website/node_modules/react/.*
22+
; Ignore expo stuff
23+
.*/node_modules/xdl/.*
24+
.*/node_modules/@expo/traveling-fastlane-linux/.*
25+
.*/node_modules/@expo/traveling-fastlane-darwin/.*
2626

27-
; Ignore some modules we don't need to parse
28-
.*/node_modules/prettier/.*
29-
.*/node_modules/eslint.*
27+
<PROJECT_ROOT>/example/node_modules/.*config-chain/test/broken.json
28+
<PROJECT_ROOT>/example/node_modules/reqwest
29+
30+
[untyped]
31+
<PROJECT_ROOT>/node_modules/react-native-safe-area-view
32+
<PROJECT_ROOT>/example/node_modules/react-native
3033

3134
[include]
3235

3336
[libs]
3437
node_modules/react-native/Libraries/react-native/react-native-interface.js
3538
node_modules/react-native/flow/
39+
flow-typed
40+
flow
3641

3742
[options]
43+
server.max_workers=1
3844
emoji=true
3945

46+
esproposal.optional_chaining=enable
47+
esproposal.nullish_coalescing=enable
48+
4049
module.system=haste
50+
module.system.haste.use_name_reducers=true
51+
# get basename
52+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
53+
# strip .js or .js.flow suffix
54+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
55+
# strip .ios suffix
56+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
57+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
58+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
59+
module.system.haste.paths.blacklist=.*/__tests__/.*
60+
module.system.haste.paths.blacklist=.*/__mocks__/.*
61+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
62+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
4163

4264
munge_underscores=true
4365

44-
module.name_mapper='^expo$' -> 'emptyObject'
45-
module.name_mapper='^react-navigation$' -> 'emptyObject'
46-
4766
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'
67+
module.name_mapper='^testing$' -> '<PROJECT_ROOT>/src/utils/testing.js'
68+
module.name_mapper='^src/\(.*\)$' -> '<PROJECT_ROOT>/src/\1'
69+
module.name_mapper='^scripts/\(.*\)$' -> '<PROJECT_ROOT>/scripts/\1'
70+
71+
72+
module.file_ext=.android.js
73+
module.file_ext=.ios.js
74+
module.file_ext=.js
75+
module.file_ext=.jsx
76+
module.file_ext=.json
77+
module.file_ext=.native.js
4878

4979
suppress_type=$FlowIssue
5080
suppress_type=$FlowFixMe
5181
suppress_type=$FlowFixMeProps
5282
suppress_type=$FlowFixMeState
53-
suppress_type=$FixMe
5483

55-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
56-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
84+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
85+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
5786
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5887
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
5988

60-
unsafe.enable_getters_and_setters=true
89+
include_warnings=true
6190

6291
[version]
63-
^0.53.0
92+
^0.92.0

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
singleQuote: true
3+
tabWidth: 2
4+
trailingComma: "es5"
5+
useTabs: false

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+
};

docs/collection.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Uses following `theme` properties:
2929
## Props
3030

3131
### `contentContainerStyle` (optional)
32-
**type:** `StyleObj`
32+
**type:** `ViewStyleProp`
3333

3434
Styles to be applied to the section list view content container.
3535
### `data`
@@ -44,7 +44,7 @@ An array of items to be rendered.
4444
Function used to extract a unique key for each item rendered.
4545

4646
### `listStyle` (optional)
47-
**type:** `StyleObj`
47+
**type:** `ViewStyleProp`
4848

4949
Styles of underlying SectionList container
5050

docs/grouped-list.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Sections text color.
9898
Rendered at the top and bottom of each section (note this is different from ItemSeparatorComponent which is only rendered between items). These are intended to separate sections from the headers above and below and typically have the same highlight response as ItemSeparatorComponent.
9999

100100
### `sectionsStyle` (optional)
101-
**type:** `StyleObj`
101+
**type:** `ViewStyleProp`
102102

103103
Styles to apply on section list.
104104

docs/page-control-view.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { PageControlView } from 'react-native-ios-kit';
3737
Children of PageControlView, each one to be displayed as a separate page.
3838

3939
### `containerStyle` (optional)
40-
**type:** `StyleObj`
40+
**type:** `ViewStyleProp`
4141

4242
Style of wrapper container.
4343

docs/switch-row.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { SwitchRow } from 'react-native-ios-kit';
2121

2222
## Theme
2323
Uses following `theme` properties:
24-
- `positiveColor` - selected switch background color (`onTintColor`)
24+
- `positiveColor` - selected switch background color (`trackColor`)
2525

2626
## Props
2727

docs/switch.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { Switch } from 'react-native-ios-kit';
1919

2020
## Theme
2121
Uses following `theme` properties:
22-
- `positiveColor` - selected switch background color (`onTintColor`)
22+
- `positiveColor` - selected switch background color (`trackColor`)
2323

2424
## Props
2525

@@ -33,7 +33,7 @@ If true, disable all interactions for this component.
3333

3434
Invoked with the new value when the value changes.
3535

36-
### `onTintColor` (optional)
36+
### `trackColor` (optional)
3737
**type:** `string`
3838
**default value:** `positiveColor` from [`theme`](theme.html)
3939

0 commit comments

Comments
 (0)