diff --git a/.gitea/workflows/check-js.yaml b/.gitea/workflows/check-js.yaml new file mode 100644 index 00000000..983a650d --- /dev/null +++ b/.gitea/workflows/check-js.yaml @@ -0,0 +1,32 @@ +name: Check JS + +on: + pull_request: + push: + branches: + - railbird-v6 + +jobs: + typescript: + name: Check TS (tsc) + runs-on: nixos-x86_64-linux + steps: + - uses: actions/checkout@v4 + - name: Install node_modules + uses: ./.github/actions/setup-node + - name: Check TypeScript + run: yarn tsc + - name: Test web HLS + run: yarn test:web + + lint: + name: Lint JS (eslint, prettier) + runs-on: nixos-x86_64-linux + steps: + - uses: actions/checkout@v4 + - name: Install node_modules + uses: ./.github/actions/setup-node + - name: Run ESLint + run: yarn lint + - name: Verify auto-fix produces no changes + run: yarn lint --fix && git diff --exit-code HEAD diff --git a/src/Video.tsx b/src/Video.tsx index b9eb6102..42df8a36 100644 --- a/src/Video.tsx +++ b/src/Video.tsx @@ -475,7 +475,7 @@ const Video = forwardRef( (e: NativeSyntheticEvent) => { onSeekComplete?.(e.nativeEvent); }, - [onSeekComplete] + [onSeekComplete], ); const onVideoPlaybackStateChanged = useCallback( @@ -733,10 +733,10 @@ const Video = forwardRef( } // poster style - const baseStyle: StyleProp = { - ...StyleSheet.absoluteFill, - resizeMode: _posterResizeMode, - }; + const baseStyle: StyleProp = [ + StyleSheet.absoluteFill, + {resizeMode: _posterResizeMode}, + ]; let posterStyle: StyleProp = baseStyle; @@ -786,10 +786,10 @@ const Video = forwardRef( ]); const _style: StyleProp = useMemo( - () => ({ - ...StyleSheet.absoluteFill, - ...(showPoster ? {display: 'none'} : {}), - }), + () => [ + StyleSheet.absoluteFill, + showPoster ? {display: 'none'} : undefined, + ], [showPoster], );