Browse Source

eslint disable no console

Thibault Malbranche 6 years ago
parent
commit
8baf7fca68
2 changed files with 10 additions and 0 deletions
  1. 4
    0
      src/WebView.android.tsx
  2. 6
    0
      src/WebView.ios.tsx

+ 4
- 0
src/WebView.android.tsx View File

185
     if (onLoadEnd) {
185
     if (onLoadEnd) {
186
       onLoadEnd(event);
186
       onLoadEnd(event);
187
     }
187
     }
188
+    // eslint-disable-next-line no-console
188
     console.warn('Encountered an error loading page', event.nativeEvent);
189
     console.warn('Encountered an error loading page', event.nativeEvent);
189
 
190
 
190
     this.setState({
191
     this.setState({
242
         invariant(errorEvent != null, 'lastErrorEvent expected to be non-null');
243
         invariant(errorEvent != null, 'lastErrorEvent expected to be non-null');
243
       }
244
       }
244
     } else if (this.state.viewState !== WebViewState.IDLE) {
245
     } else if (this.state.viewState !== WebViewState.IDLE) {
246
+      // eslint-disable-next-line no-console
245
       console.error(
247
       console.error(
246
         `RNCWebView invalid state encountered: ${this.state.viewState}`,
248
         `RNCWebView invalid state encountered: ${this.state.viewState}`,
247
       );
249
       );
265
 
267
 
266
     if (isWebViewUriSource(source)) {
268
     if (isWebViewUriSource(source)) {
267
       if (source.method === 'POST' && source.headers) {
269
       if (source.method === 'POST' && source.headers) {
270
+        // eslint-disable-next-line no-console
268
         console.warn(
271
         console.warn(
269
           'WebView: `source.headers` is not supported when using POST.',
272
           'WebView: `source.headers` is not supported when using POST.',
270
         );
273
         );
271
       } else if (source.method === 'GET' && source.body) {
274
       } else if (source.method === 'GET' && source.body) {
275
+        // eslint-disable-next-line no-console
272
         console.warn('WebView: `source.body` is not supported when using GET.');
276
         console.warn('WebView: `source.body` is not supported when using GET.');
273
       }
277
       }
274
     }
278
     }

+ 6
- 0
src/WebView.ios.tsx View File

180
       this.props.useWebKit === true
180
       this.props.useWebKit === true
181
       && this.props.scalesPageToFit !== undefined
181
       && this.props.scalesPageToFit !== undefined
182
     ) {
182
     ) {
183
+      // eslint-disable-next-line no-console
183
       console.warn(
184
       console.warn(
184
         'The scalesPageToFit property is not supported when useWebKit = true',
185
         'The scalesPageToFit property is not supported when useWebKit = true',
185
       );
186
       );
188
       !this.props.useWebKit
189
       !this.props.useWebKit
189
       && this.props.allowsBackForwardNavigationGestures
190
       && this.props.allowsBackForwardNavigationGestures
190
     ) {
191
     ) {
192
+      // eslint-disable-next-line no-console
191
       console.warn(
193
       console.warn(
192
         'The allowsBackForwardNavigationGestures property is not supported when useWebKit = false',
194
         'The allowsBackForwardNavigationGestures property is not supported when useWebKit = false',
193
       );
195
       );
204
     this.showRedboxOnPropChanges(prevProps, 'dataDetectorTypes');
206
     this.showRedboxOnPropChanges(prevProps, 'dataDetectorTypes');
205
 
207
 
206
     if (this.props.scalesPageToFit !== undefined) {
208
     if (this.props.scalesPageToFit !== undefined) {
209
+      // eslint-disable-next-line no-console
207
       console.warn(
210
       console.warn(
208
         'The scalesPageToFit property is not supported when useWebKit = true',
211
         'The scalesPageToFit property is not supported when useWebKit = true',
209
       );
212
       );
335
     if (onLoadEnd) {
338
     if (onLoadEnd) {
336
       onLoadEnd(event);
339
       onLoadEnd(event);
337
     }
340
     }
341
+    // eslint-disable-next-line no-console
338
     console.warn('Encountered an error loading page', event.nativeEvent);
342
     console.warn('Encountered an error loading page', event.nativeEvent);
339
 
343
 
340
     this.setState({
344
     this.setState({
381
       | 'dataDetectorTypes',
385
       | 'dataDetectorTypes',
382
   ): void {
386
   ): void {
383
     if (this.props[propName] !== prevProps[propName]) {
387
     if (this.props[propName] !== prevProps[propName]) {
388
+      // eslint-disable-next-line no-console
384
       console.error(
389
       console.error(
385
         `Changes to property ${propName} do nothing after the initial render.`,
390
         `Changes to property ${propName} do nothing after the initial render.`,
386
       );
391
       );
412
         invariant(errorEvent != null, 'lastErrorEvent expected to be non-null');
417
         invariant(errorEvent != null, 'lastErrorEvent expected to be non-null');
413
       }
418
       }
414
     } else if (this.state.viewState !== WebViewState.IDLE) {
419
     } else if (this.state.viewState !== WebViewState.IDLE) {
420
+      // eslint-disable-next-line no-console
415
       console.error(
421
       console.error(
416
         `RNCWebView invalid state encountered: ${this.state.viewState}`,
422
         `RNCWebView invalid state encountered: ${this.state.viewState}`,
417
       );
423
       );