소스 검색

eslint disable no console

Thibault Malbranche 6 년 전
부모
커밋
8baf7fca68
2개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 4
    0
      src/WebView.android.tsx
  2. 6
    0
      src/WebView.ios.tsx

+ 4
- 0
src/WebView.android.tsx 파일 보기

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

+ 6
- 0
src/WebView.ios.tsx 파일 보기

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