From 32da54ab4654f6f9d2993f1c4ae9d8d0fec1b830 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Tue, 23 Feb 2021 11:57:43 +0100 Subject: [PATCH] Fix a few ESLint errors --- example/babel.config.js | 1 + example/src/Splash.tsx | 9 ++++++--- example/src/views/CaptureButton.tsx | 2 +- example/src/views/StatusBarBlurBackground.tsx | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/example/babel.config.js b/example/babel.config.js index 030b38d..511b065 100644 --- a/example/babel.config.js +++ b/example/babel.config.js @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ const path = require('path'); const pak = require('../package.json'); diff --git a/example/src/Splash.tsx b/example/src/Splash.tsx index 77bf6fb..c61e804 100644 --- a/example/src/Splash.tsx +++ b/example/src/Splash.tsx @@ -1,10 +1,14 @@ import React, { useCallback, useEffect, useState } from 'react'; +import type { ImageRequireSource } from 'react-native'; import { StyleSheet, View, Text, Image } from 'react-native'; import { Navigation, NavigationFunctionComponent } from 'react-native-navigation'; import { Camera, CameraPermissionStatus } from 'react-native-vision-camera'; import { CONTENT_SPACING, SAFE_AREA_PADDING } from './Constants'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const BANNER_IMAGE = require('../../img/11.png') as ImageRequireSource; + export const Splash: NavigationFunctionComponent = ({ componentId }) => { const [cameraPermissionStatus, setCameraPermissionStatus] = useState('not-determined'); const [microphonePermissionStatus, setMicrophonePermissionStatus] = useState('not-determined'); @@ -24,7 +28,7 @@ export const Splash: NavigationFunctionComponent = ({ componentId }) => { }, []); useEffect(() => { - const checkPermissions = async () => { + const checkPermissions = async (): Promise => { console.log('Checking Permission status...'); const [cameraPermission, microphonePermission] = await Promise.all([ Camera.getCameraPermissionStatus(), @@ -58,9 +62,8 @@ export const Splash: NavigationFunctionComponent = ({ componentId }) => { return ( - + Welcome to{'\n'}Vision Camera. - {cameraPermissionStatus !== 'authorized' && ( diff --git a/example/src/views/CaptureButton.tsx b/example/src/views/CaptureButton.tsx index d7a2665..c349f86 100644 --- a/example/src/views/CaptureButton.tsx +++ b/example/src/views/CaptureButton.tsx @@ -125,7 +125,7 @@ const _CaptureButton: React.FC = ({ } catch (e) { console.error('failed to start recording!', e, 'camera'); } - }, [camera, flash, onMediaCaptured, onStoppedRecording, recordingProgress, stopRecording]); + }, [camera, flash, onMediaCaptured, onStoppedRecording]); //#endregion //#region Tap handler diff --git a/example/src/views/StatusBarBlurBackground.tsx b/example/src/views/StatusBarBlurBackground.tsx index 90e7b43..fe570f5 100644 --- a/example/src/views/StatusBarBlurBackground.tsx +++ b/example/src/views/StatusBarBlurBackground.tsx @@ -5,7 +5,7 @@ import StaticSafeAreaInsets from 'react-native-static-safe-area-insets'; const FALLBACK_COLOR = 'rgba(140, 140, 140, 0.3)'; -const StatusBarBlurBackgroundImpl = ({ style, ...props }: BlurViewProperties) => { +const StatusBarBlurBackgroundImpl = ({ style, ...props }: BlurViewProperties): React.ReactElement | null => { if (Platform.OS !== 'ios') return null; return (