@exodus/react-native-webview 11.26.1-exodus.32 → 11.26.1-exodus.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java +24 -7
  2. package/apple/RNCWebView.m +10 -11
  3. package/apple/RNCWebViewManager.m +1 -0
  4. package/lib/WebViewShared.js +1 -1
  5. package/lib/WebViewTypes.d.ts +5 -0
  6. package/package.json +1 -1
  7. package/.all-contributorsrc +0 -185
  8. package/.circleci/config.yml +0 -66
  9. package/.eslintignore +0 -2
  10. package/.eslintrc.js +0 -94
  11. package/.flowconfig +0 -88
  12. package/.flowconfig.android +0 -88
  13. package/.gitattributes +0 -12
  14. package/.github/CODEOWNERS +0 -1
  15. package/.github/ISSUE_TEMPLATE/bug-report.md +0 -42
  16. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -30
  17. package/.github/workflows/android-ci.yml +0 -35
  18. package/.github/workflows/detox.yml +0 -20
  19. package/.github/workflows/ios-ci.yml +0 -31
  20. package/.github/workflows/scripts/install-vs-features.ps1 +0 -108
  21. package/.github/workflows/stale.yml +0 -17
  22. package/.gitignore +0 -62
  23. package/.idea/.gitignore +0 -5
  24. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  25. package/.idea/misc.xml +0 -9
  26. package/.idea/modules.xml +0 -8
  27. package/.idea/react-native-webview.iml +0 -9
  28. package/.idea/vcs.xml +0 -6
  29. package/.idea/workspace.xml +0 -104
  30. package/.prettierrc.js +0 -10
  31. package/.releaserc +0 -15
  32. package/.vscode/settings.json +0 -9
  33. package/babel.config.js +0 -11
  34. package/bin/setup +0 -26
  35. package/docs/Contributing.md +0 -102
  36. package/docs/Custom-Android.md +0 -222
  37. package/docs/Custom-iOS.md +0 -236
  38. package/docs/Debugging.md +0 -101
  39. package/docs/Getting-Started.md +0 -142
  40. package/docs/Guide.md +0 -613
  41. package/docs/Reference.md +0 -1639
  42. package/example/.gitignore +0 -14
  43. package/example/.watchmanconfig +0 -1
  44. package/example/App.tsx +0 -262
  45. package/example/android/build.gradle +0 -15
  46. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  47. package/example/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  48. package/example/android/gradle.properties +0 -34
  49. package/example/android/gradlew +0 -234
  50. package/example/android/gradlew.bat +0 -89
  51. package/example/android/settings.gradle +0 -12
  52. package/example/app.json +0 -20
  53. package/example/assets/test.html +0 -9
  54. package/example/babel.config.js +0 -3
  55. package/example/examples/Alerts.tsx +0 -72
  56. package/example/examples/ApplePay.tsx +0 -23
  57. package/example/examples/Background.tsx +0 -54
  58. package/example/examples/Downloads.tsx +0 -57
  59. package/example/examples/Injection.tsx +0 -161
  60. package/example/examples/LocalPageLoad.tsx +0 -16
  61. package/example/examples/Messaging.tsx +0 -63
  62. package/example/examples/NativeWebpage.tsx +0 -22
  63. package/example/examples/Scrolling.tsx +0 -68
  64. package/example/examples/Uploads.tsx +0 -69
  65. package/example/index.js +0 -9
  66. package/example/ios/Podfile +0 -8
  67. package/example/ios/Podfile.lock +0 -445
  68. package/jest-setups/jest.setup.js +0 -8
  69. package/jest.config.js +0 -184
  70. package/lib/WebView.android.d.ts.map +0 -1
  71. package/lib/WebView.d.ts.map +0 -1
  72. package/lib/WebView.ios.d.ts.map +0 -1
  73. package/lib/WebView.styles.d.ts.map +0 -1
  74. package/lib/WebViewNativeComponent.android.d.ts.map +0 -1
  75. package/lib/WebViewNativeComponent.ios.d.ts.map +0 -1
  76. package/lib/WebViewShared.d.ts.map +0 -1
  77. package/lib/WebViewTypes.d.ts.map +0 -1
  78. package/lib/index.d.ts.map +0 -1
  79. package/lib/validation.d.ts.map +0 -1
  80. package/metro.config.js +0 -57
  81. package/src/WebView.android.tsx +0 -255
  82. package/src/WebView.ios.tsx +0 -230
  83. package/src/WebView.styles.ts +0 -44
  84. package/src/WebView.tsx +0 -18
  85. package/src/WebViewNativeComponent.android.ts +0 -8
  86. package/src/WebViewNativeComponent.ios.ts +0 -8
  87. package/src/WebViewShared.tsx +0 -318
  88. package/src/WebViewTypes.ts +0 -941
  89. package/src/__tests__/WebViewShared-test.js +0 -292
  90. package/src/__tests__/__snapshots__/WebViewShared-test.js.snap +0 -13
  91. package/src/__tests__/validation-test.js +0 -39
  92. package/src/index.ts +0 -4
  93. package/src/validation.ts +0 -13
  94. package/tsconfig.json +0 -24
  95. package/yarn.lock +0 -13397
@@ -166,13 +166,7 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
166
166
  protected @Nullable String mDownloadingMessage = null;
167
167
  protected @Nullable String mLackPermissionToDownloadMessage = null;
168
168
 
169
- private static Set<String> cameraPermissionOriginWhitelist;
170
-
171
169
  public RNCWebViewManager() {
172
- cameraPermissionOriginWhitelist = new HashSet<>();
173
- cameraPermissionOriginWhitelist.add("https://alchemy.veriff.com/");
174
- cameraPermissionOriginWhitelist.add("https://magic.veriff.me/");
175
-
176
170
  mWebViewConfig = new WebViewConfig() {
177
171
  public void configWebView(WebView webView) {
178
172
  }
@@ -232,6 +226,16 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
232
226
  return mDownloadingMessage == null ? DEFAULT_LACK_PERMISSION_TO_DOWNLOAD_MESSAGE : mLackPermissionToDownloadMessage;
233
227
  }
234
228
 
229
+ @ReactProp(name = "cameraPermissionOriginWhitelist")
230
+ public void setCameraPermissionOriginWhitelist(RNCWebView webView, ReadableArray whitelist) {
231
+ Set<String> whitelistSet = new HashSet<>();
232
+ for (int i = 0; i < whitelist.size(); i++) {
233
+ whitelistSet.add(whitelist.getString(i));
234
+ }
235
+
236
+ mWebChromeClient.setCameraPermissionOriginWhitelist(whitelistSet);
237
+ }
238
+
235
239
  @ReactProp(name = "javaScriptEnabled")
236
240
  public void setJavaScriptEnabled(WebView view, boolean enabled) {
237
241
  view.getSettings().setJavaScriptEnabled(enabled);
@@ -998,12 +1002,17 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
998
1002
 
999
1003
  // True if protected media should be allowed, false otherwise
1000
1004
  protected boolean mAllowsProtectedMedia = false;
1005
+ private Set<String> cameraPermissionOriginWhitelist = new HashSet<>();
1001
1006
 
1002
1007
  public RNCWebChromeClient(ReactContext reactContext, WebView webView) {
1003
1008
  this.mReactContext = reactContext;
1004
1009
  this.mWebView = webView;
1005
1010
  }
1006
1011
 
1012
+ public void setCameraPermissionOriginWhitelist(Set<String> whitelist) {
1013
+ this.cameraPermissionOriginWhitelist = whitelist;
1014
+ }
1015
+
1007
1016
  @Override
1008
1017
  public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
1009
1018
 
@@ -1065,11 +1074,19 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
1065
1074
  grantedPermissions = new ArrayList<>();
1066
1075
 
1067
1076
  ArrayList<String> requestedAndroidPermissions = new ArrayList<>();
1077
+ final Uri originUri = request.getOrigin();
1078
+ final String scheme = originUri.getScheme();
1079
+ final int port = originUri.getPort();
1080
+ String origin = scheme + "://" + originUri.getHost();
1081
+
1082
+ if (port > 0 && ((scheme == "http" && port != 80) || (scheme == "https" && port != 443))) {
1083
+ origin += ":" + port;
1084
+ }
1068
1085
 
1069
1086
  for (String requestedResource : request.getResources()) {
1070
1087
  String androidPermission = null;
1071
1088
 
1072
- if (cameraPermissionOriginWhitelist.contains(request.getOrigin().toString())) {
1089
+ if (this.cameraPermissionOriginWhitelist.contains(origin)) {
1073
1090
  if (requestedResource.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) {
1074
1091
  androidPermission = Manifest.permission.CAMERA;
1075
1092
  } else if (requestedResource.equals(PermissionRequest.RESOURCE_AUDIO_CAPTURE)) {
@@ -22,6 +22,7 @@ static NSString *const HistoryShimName = @"ReactNativeHistoryShim";
22
22
  static NSString *const MessageHandlerName = @"ReactNativeWebView";
23
23
  static NSURLCredential* clientAuthenticationCredential;
24
24
  static NSDictionary* customCertificatesForHost;
25
+ static NSSet *cameraPermissionOriginWhitelist;
25
26
 
26
27
  NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
27
28
 
@@ -70,6 +71,7 @@ RCTAutoInsetsProtocol>
70
71
  @property (nonatomic, strong) WKUserScript *postMessageScript;
71
72
  @property (nonatomic, strong) WKUserScript *atStartScript;
72
73
  @property (nonatomic, strong) WKUserScript *atEndScript;
74
+ @property (nonatomic, strong) NSArray<NSString *> *cameraPermissionOriginWhitelist;
73
75
  @end
74
76
 
75
77
  @implementation RNCWebView
@@ -1054,19 +1056,16 @@ RCTAutoInsetsProtocol>
1054
1056
  initiatedByFrame:(WKFrameInfo *)frame
1055
1057
  type:(WKMediaCaptureType)type
1056
1058
  decisionHandler:(void (^)(WKPermissionDecision decision))decisionHandler {
1057
- if (_mediaCapturePermissionGrantType == RNCWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt || _mediaCapturePermissionGrantType == RNCWebViewPermissionGrantType_GrantIfSameHost_ElseDeny) {
1058
- if ([origin.host isEqualToString:webView.URL.host]) {
1059
- decisionHandler(WKPermissionDecisionGrant);
1060
- } else {
1061
- WKPermissionDecision decision = _mediaCapturePermissionGrantType == RNCWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt ? WKPermissionDecisionPrompt : WKPermissionDecisionDeny;
1062
- decisionHandler(decision);
1063
- }
1064
- } else if (_mediaCapturePermissionGrantType == RNCWebViewPermissionGrantType_Deny) {
1065
- decisionHandler(WKPermissionDecisionDeny);
1066
- } else if (_mediaCapturePermissionGrantType == RNCWebViewPermissionGrantType_Grant) {
1059
+ NSString *originString = [NSString stringWithFormat:@"%@://%@", origin.protocol, origin.host];
1060
+
1061
+ if (origin.port > 0 && (([origin.protocol isEqualToString:@"http"] && origin.port != 80) || ([origin.protocol isEqualToString:@"https"] && origin.port != 443))) {
1062
+ originString = [originString stringByAppendingFormat:@":%ld", (long)origin.port];
1063
+ }
1064
+
1065
+ if ([self.cameraPermissionOriginWhitelist containsObject:originString]) {
1067
1066
  decisionHandler(WKPermissionDecisionGrant);
1068
1067
  } else {
1069
- decisionHandler(WKPermissionDecisionPrompt);
1068
+ decisionHandler(WKPermissionDecisionDeny);
1070
1069
  }
1071
1070
  }
1072
1071
  #endif
@@ -78,6 +78,7 @@ RCT_EXPORT_VIEW_PROPERTY(pagingEnabled, BOOL)
78
78
  RCT_EXPORT_VIEW_PROPERTY(cacheEnabled, BOOL)
79
79
  RCT_EXPORT_VIEW_PROPERTY(allowsLinkPreview, BOOL)
80
80
  RCT_EXPORT_VIEW_PROPERTY(basicAuthCredential, NSDictionary)
81
+ RCT_EXPORT_VIEW_PROPERTY(cameraPermissionOriginWhitelist, NSArray)
81
82
 
82
83
  #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
83
84
  RCT_EXPORT_VIEW_PROPERTY(contentInsetAdjustmentBehavior, UIScrollViewContentInsetAdjustmentBehavior)
@@ -99,7 +99,7 @@ export const useWebWiewLogic = ({ startInLoadingState, onLoadStart, onLoad, onLo
99
99
  const extractMeta = (nativeEvent) => ({
100
100
  url: String(nativeEvent.url),
101
101
  loading: Boolean(nativeEvent.loading),
102
- title: String(nativeEvent.title),
102
+ title: String(nativeEvent.title).slice(0, 512),
103
103
  canGoBack: Boolean(nativeEvent.canGoBack),
104
104
  canGoForward: Boolean(nativeEvent.canGoForward),
105
105
  lockIdentifier: Number(nativeEvent.lockIdentifier),
@@ -145,6 +145,7 @@ export interface BasicAuthCredential {
145
145
  }
146
146
  export interface CommonNativeWebViewProps extends ViewProps {
147
147
  cacheEnabled?: boolean;
148
+ cameraPermissionOriginWhitelist?: string[];
148
149
  incognito?: boolean;
149
150
  injectedJavaScript?: string;
150
151
  injectedJavaScriptBeforeContentLoaded?: string;
@@ -635,6 +636,10 @@ export interface WebViewSharedProps extends ViewProps {
635
636
  * @platform android
636
637
  */
637
638
  javaScriptEnabled?: boolean;
639
+ /**
640
+ * Defines a list of domain origins that can access camera.
641
+ */
642
+ readonly cameraPermissionOriginWhitelist?: string[];
638
643
  /**
639
644
  * Stylesheet object to set the style of the container view.
640
645
  */
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "Thibault Malbranche <malbranche.thibault@gmail.com>"
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "11.26.1-exodus.32",
12
+ "version": "11.26.1-exodus.34",
13
13
  "homepage": "https://github.com/ExodusMovement/react-native-webview#readme",
14
14
  "scripts": {
15
15
  "android": "react-native run-android",
@@ -1,185 +0,0 @@
1
- {
2
- "projectName": "react-native-webview",
3
- "projectOwner": "react-native-webview",
4
- "repoType": "github",
5
- "repoHost": "https://github.com",
6
- "files": [
7
- "README.md"
8
- ],
9
- "imageSize": 100,
10
- "commit": false,
11
- "contributors": [
12
- {
13
- "login": "titozzz",
14
- "name": "Thibault Malbranche",
15
- "avatar_url": "https://avatars1.githubusercontent.com/u/6181446?v=4",
16
- "profile": "https://twitter.com/titozzz",
17
- "contributions": [
18
- "code",
19
- "ideas",
20
- "review",
21
- "doc",
22
- "maintenance",
23
- "test",
24
- "infra",
25
- "question"
26
- ]
27
- },
28
- {
29
- "login": "jamonholmgren",
30
- "name": "Jamon Holmgren",
31
- "avatar_url": "https://avatars3.githubusercontent.com/u/1479215?v=4",
32
- "profile": "https://jamonholmgren.com",
33
- "contributions": [
34
- "code",
35
- "ideas",
36
- "review",
37
- "doc",
38
- "maintenance",
39
- "test",
40
- "example",
41
- "question"
42
- ]
43
- },
44
- {
45
- "login": "andreipfeiffer",
46
- "name": "Andrei Pfeiffer",
47
- "avatar_url": "https://avatars1.githubusercontent.com/u/2570562?v=4",
48
- "profile": "https://github.com/andreipfeiffer",
49
- "contributions": [
50
- "code",
51
- "review",
52
- "ideas"
53
- ]
54
- },
55
- {
56
- "login": "Salakar",
57
- "name": "Michael Diarmid",
58
- "avatar_url": "https://avatars0.githubusercontent.com/u/5347038?v=4",
59
- "profile": "https://twitter.com/mikediarmid",
60
- "contributions": [
61
- "code",
62
- "review",
63
- "ideas",
64
- "tool"
65
- ]
66
- },
67
- {
68
- "login": "smathson",
69
- "name": "Scott Mathson",
70
- "avatar_url": "https://avatars3.githubusercontent.com/u/932981?v=4",
71
- "profile": "http://smathson.github.io",
72
- "contributions": [
73
- "code",
74
- "doc"
75
- ]
76
- },
77
- {
78
- "login": "YangXiaomei",
79
- "name": "Margaret",
80
- "avatar_url": "https://avatars0.githubusercontent.com/u/8221990?v=4",
81
- "profile": "https://github.com/YangXiaomei",
82
- "contributions": [
83
- "code",
84
- "doc"
85
- ]
86
- },
87
- {
88
- "login": "jordansexton",
89
- "name": "Jordan Sexton",
90
- "avatar_url": "https://avatars2.githubusercontent.com/u/1173161?v=4",
91
- "profile": "https://stylisted.com",
92
- "contributions": [
93
- "code",
94
- "doc"
95
- ]
96
- },
97
- {
98
- "login": "MalcolmScruggs",
99
- "name": "Malcolm Scruggs",
100
- "avatar_url": "https://avatars1.githubusercontent.com/u/22333355?v=4",
101
- "profile": "https://github.com/MalcolmScruggs",
102
- "contributions": [
103
- "code",
104
- "tool",
105
- "test"
106
- ]
107
- },
108
- {
109
- "login": "Momazo7u7",
110
- "name": "Momazo7u7",
111
- "avatar_url": "https://avatars0.githubusercontent.com/u/42069617?v=4",
112
- "profile": "https://github.com/Momazo7u7",
113
- "contributions": [
114
- "doc"
115
- ]
116
- },
117
- {
118
- "login": "marconett",
119
- "name": "Marco",
120
- "avatar_url": "https://avatars1.githubusercontent.com/u/3315507?v=4",
121
- "profile": "https://marco-nett.de",
122
- "contributions": [
123
- "doc"
124
- ]
125
- },
126
- {
127
- "login": "jeluard",
128
- "name": "Julien Eluard",
129
- "avatar_url": "https://avatars1.githubusercontent.com/u/359723?v=4",
130
- "profile": "https://github.com/jeluard",
131
- "contributions": [
132
- "doc"
133
- ]
134
- },
135
- {
136
- "login": "CubeSugar",
137
- "name": "Jian Wei",
138
- "avatar_url": "https://avatars3.githubusercontent.com/u/3667305?v=4",
139
- "profile": "https://github.com/CubeSugar",
140
- "contributions": [
141
- "code",
142
- "doc"
143
- ]
144
- },
145
- {
146
- "login": "svbutko",
147
- "name": "Sergei Butko",
148
- "avatar_url": "https://avatars2.githubusercontent.com/u/14828004?v=4",
149
- "profile": "https://www.linkedin.com/in/svbutko/",
150
- "contributions": [
151
- "doc"
152
- ]
153
- },
154
- {
155
- "login": "TMomemt",
156
- "name": "TMomemt",
157
- "avatar_url": "https://avatars3.githubusercontent.com/u/42024947?v=4",
158
- "profile": "https://github.com/TMomemt",
159
- "contributions": [
160
- "code"
161
- ]
162
- },
163
- {
164
- "login": "ericlewis",
165
- "name": "Eric Lewis",
166
- "avatar_url": "https://avatars0.githubusercontent.com/u/674503?v=4",
167
- "profile": "http://www.try.com",
168
- "contributions": [
169
- "code",
170
- "doc"
171
- ]
172
- },
173
- {
174
- "login": "dvicory",
175
- "name": "Daniel Vicory",
176
- "avatar_url": "https://avatars2.githubusercontent.com/u/1542454?v=4",
177
- "profile": "https://bzfx.net",
178
- "contributions": [
179
- "code",
180
- "doc"
181
- ]
182
- }
183
- ],
184
- "contributorsPerLine": 7
185
- }
@@ -1,66 +0,0 @@
1
- defaults: &defaults
2
- working_directory: ~/code
3
- docker:
4
- - image: cimg/node:16.13.0-browsers
5
-
6
- version: 2
7
- jobs:
8
- setup:
9
- <<: *defaults
10
- steps:
11
- - checkout
12
- - restore_cache:
13
- name: Restore node modules
14
- keys:
15
- - node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
16
-
17
- - run:
18
- name: Install dependencies
19
- command: yarn --pure-lockfile
20
-
21
- - save_cache:
22
- name: Save node modules
23
- key: node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
24
- paths:
25
- - node_modules
26
-
27
- tests:
28
- <<: *defaults
29
- steps:
30
- - checkout
31
- - restore_cache:
32
- name: Restore node modules
33
- keys:
34
- - node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
35
-
36
- - run:
37
- name: Lint checks
38
- command: yarn ci
39
-
40
- publish:
41
- <<: *defaults
42
- steps:
43
- - checkout
44
- - restore_cache:
45
- name: Restore node modules
46
- keys:
47
- - node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
48
-
49
- - run:
50
- name: Publish to NPM
51
- command: yarn ci:publish
52
-
53
- workflows:
54
- version: 2
55
- ci:
56
- jobs:
57
- - setup
58
- - tests:
59
- requires:
60
- - setup
61
- - publish:
62
- requires:
63
- - tests
64
- filters:
65
- branches:
66
- only: master
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
- lib/
2
- babel.config.js
package/.eslintrc.js DELETED
@@ -1,94 +0,0 @@
1
- module.exports = {
2
- // Airbnb is the base, prettier is here so that eslint doesn't conflict with prettier
3
- extends: ['airbnb', 'prettier', 'prettier/react', 'plugin:react-hooks/recommended'],
4
- parser: '@typescript-eslint/parser',
5
- plugins: ['react', 'react-native', 'import', '@typescript-eslint'],
6
- rules: {
7
- 'no-console': 'off',
8
- 'no-underscore-dangle': 'off',
9
- // Lines will be broken before binary operators
10
- 'operator-linebreak': ['error', 'before'],
11
- // Allow imports from dev and peer dependencies
12
- 'import/no-extraneous-dependencies': [
13
- 'error',
14
- { devDependencies: true, peerDependencies: true },
15
- ],
16
- 'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
17
- // This rule doesn't play nice with Prettier
18
- 'react/jsx-one-expression-per-line': 'off',
19
- // This rule doesn't play nice with Prettier
20
- 'react/jsx-wrap-multilines': 'off',
21
- // Remove this rule because we only destructure props, but never state
22
- 'react/destructuring-assignment': 'off',
23
- 'react/prop-types': 'off',
24
- 'react/jsx-props-no-spreading': 'off',
25
- 'react/static-property-placement': 'off',
26
- 'react/state-in-constructor': 'off',
27
- '@typescript-eslint/adjacent-overload-signatures': 'error',
28
- '@typescript-eslint/array-type': [
29
- 'error',
30
- {
31
- default: 'array',
32
- },
33
- ],
34
- '@typescript-eslint/generic-type-naming': ['error', '^[a-zA-Z]+$'],
35
- '@typescript-eslint/no-array-constructor': 'error',
36
- '@typescript-eslint/no-empty-interface': 'error',
37
- '@typescript-eslint/no-explicit-any': 'error',
38
- '@typescript-eslint/no-extraneous-class': 'error',
39
- '@typescript-eslint/no-inferrable-types': 'error',
40
- '@typescript-eslint/no-misused-new': 'error',
41
- '@typescript-eslint/no-namespace': 'error',
42
- '@typescript-eslint/no-non-null-assertion': 'error',
43
- '@typescript-eslint/consistent-type-assertions': [
44
- 'error',
45
- {
46
- assertionStyle: 'as',
47
- },
48
- ],
49
- '@typescript-eslint/no-parameter-properties': 'error',
50
- '@typescript-eslint/no-this-alias': 'error',
51
- '@typescript-eslint/triple-slash-reference': [
52
- 'error',
53
- { path: 'never', types: 'never', lib: 'never' },
54
- ],
55
- '@typescript-eslint/no-type-alias': [
56
- 'error',
57
- {
58
- allowAliases: 'always',
59
- allowCallbacks: 'always',
60
- allowMappedTypes: 'always',
61
- },
62
- ],
63
- '@typescript-eslint/no-unused-vars': [
64
- 'error',
65
- { ignoreRestSiblings: true },
66
- ],
67
- '@typescript-eslint/consistent-type-definitions': [
68
- 'error',
69
- 'interface',
70
- ],
71
- '@typescript-eslint/prefer-namespace-keyword': 'error',
72
- '@typescript-eslint/type-annotation-spacing': 'error',
73
- },
74
- settings: {
75
- 'import/resolver': {
76
- node: {
77
- extensions: [
78
- '.js',
79
- '.android.js',
80
- '.ios.js',
81
- '.jsx',
82
- '.android.jsx',
83
- '.ios.jsx',
84
- '.tsx',
85
- '.ts',
86
- '.android.tsx',
87
- '.android.ts',
88
- '.ios.tsx',
89
- '.ios.ts',
90
- ],
91
- },
92
- },
93
- },
94
- };
package/.flowconfig DELETED
@@ -1,88 +0,0 @@
1
- [ignore]
2
- ; This flowconfig is forked by platform - the only difference between them is which suffix is ignored.
3
- .*/*[.]android.js
4
- ;.*/*[.]ios.js
5
-
6
- ; Ignore templates for 'react-native init'
7
- .*/local-cli/templates/.*
8
-
9
- ; Ignore the Dangerfile
10
- node_modules/react-native/bots/dangerfile.js
11
-
12
- ; Ignore "BUCK" generated dirs
13
- node_modules/react-native/\.buckd/
14
-
15
- ; Ignore unexpected extra "@providesModule"
16
- .*/node_modules/.*/node_modules/fbjs/.*
17
-
18
- ; Ignore duplicate module providers
19
- ; For RN Apps installed via npm, "Libraries" folder is inside
20
- ; "node_modules/react-native" but in the source repo it is in the root
21
- .*/Libraries/react-native/React.js
22
-
23
- ; Ignore polyfills
24
- .*/Libraries/polyfills/.*
25
-
26
- ; Ignore metro
27
- .*/node_modules/metro/.*
28
-
29
- ; Ignore "config-chain"'s test folder - it has a corrupt JSON file that's tripping flow
30
- .*/node_modules/config-chain/test/*.
31
-
32
- ; These should not be required directly
33
- ; require from fbjs/lib instead: require('fbjs/lib/invariant')
34
- .*/node_modules/invariant/.*
35
- .*/node_modules/warning/.*
36
-
37
- [include]
38
-
39
- [libs]
40
- node_modules/react-native/Libraries/react-native/react-native-interface.js
41
- node_modules/react-native/flow/
42
- node_modules/react-native/flow-github/
43
-
44
- [lints]
45
-
46
- [options]
47
- emoji=true
48
-
49
- esproposal.optional_chaining=enable
50
- esproposal.nullish_coalescing=enable
51
-
52
- module.system=haste
53
- module.system.haste.use_name_reducers=true
54
- # keep the following in sync with server/haste/hasteImpl.js
55
- # get basename
56
- module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
57
- # strip .js or .js.flow suffix
58
- module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
59
- # strip platform suffix
60
- module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
61
- module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
62
- module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
63
- module.system.haste.paths.blacklist=.*/__tests__/.*
64
- module.system.haste.paths.blacklist=.*/__mocks__/.*
65
- module.system.haste.paths.whitelist=<PROJECT_ROOT>/js/.*
66
- module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
67
- module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
68
- module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
69
- module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
70
- ; Surpress error `Duplicate module provider` until the slimmening is done
71
- module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Components/WebView/*.
72
- module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Components/WKWebView/*.
73
-
74
- munge_underscores=true
75
-
76
- 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'
77
-
78
- suppress_type=$FlowIssue
79
- suppress_type=$FlowFixMe
80
- suppress_type=$FlowFixMeProps
81
- suppress_type=$FlowFixMeState
82
-
83
- suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native\\(_android\\)?_oss|react_native\\(_android\\)?_fb][a-z,_]*\\)?)\\)
84
- suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native\\(_android\\)?_oss|react_native\\(_android\\)?_fb][a-z,_]*\\)?)\\)?:? #[0-9]+
85
- suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
86
- suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
87
-
88
- [strict]