Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/consistent-type-imports": "error",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one I did read, and it looks fine

"@typescript-eslint/consistent-type-exports": "error",
Comment thread
m-bert marked this conversation as resolved.
Comment thread
m-bert marked this conversation as resolved.

// common
"@typescript-eslint/explicit-module-boundary-types": "off",
Expand Down Expand Up @@ -85,6 +87,7 @@
],
"curly": "error",
"spaced-comment": "error",
"no-alert": "warn"
"no-alert": "warn",
"sort-imports": "error"
Comment thread
m-bert marked this conversation as resolved.
}
}
10 changes: 4 additions & 6 deletions apps/basic-example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import * as React from 'react';
import { SafeAreaView, Platform } from 'react-native';
import { Platform, SafeAreaView } from 'react-native';
import ContentsButton from './ContentsButton';
import { GestureHandlerRootView } from 'react-native-gesture-handler';

import Navigator from './Navigator';

import Text from './Text';
import NativeDetector from './NativeDetector';
import Navigator from './Navigator';
import RuntimeDecoration from './RuntimeDecoration';
import ContentsButton from './ContentsButton';
import Text from './Text';

const EXAMPLES = [
{
Expand Down
6 changes: 3 additions & 3 deletions apps/basic-example/src/ContentsButton.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { View, StyleSheet, Text, SafeAreaView } from 'react-native';
import {
GestureHandlerRootView,
ScrollView,
RectButton,
ScrollView,
} from 'react-native-gesture-handler';
import { SafeAreaView, StyleSheet, Text, View } from 'react-native';
import React from 'react';

export default function ComplexUI() {
return (
Expand Down
2 changes: 1 addition & 1 deletion apps/basic-example/src/NativeDetector.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react';
import { Animated, Button, useAnimatedValue } from 'react-native';
import {
GestureHandlerRootView,
GestureDetector,
GestureHandlerRootView,
usePanGesture,
} from 'react-native-gesture-handler';

Expand Down
2 changes: 1 addition & 1 deletion apps/basic-example/src/Navigator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BackHandler, Pressable, Text, View } from 'react-native';
import React, { useEffect, useState } from 'react';
import { View, Text, Pressable, BackHandler } from 'react-native';

export interface RouteInfo {
component: React.ComponentType;
Expand Down
7 changes: 3 additions & 4 deletions apps/basic-example/src/RuntimeDecoration.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import * as React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Gesture, GestureDetector } from 'react-native-gesture-handler';

import { COLORS } from './colors';
import Animated, {
runOnJS,
useAnimatedStyle,
useSharedValue,
} from 'react-native-reanimated';
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
import { StyleSheet, Text, View } from 'react-native';
import { COLORS } from './colors';
import { useState } from 'react';

export function RuntimeChecker({
Expand Down
3 changes: 1 addition & 2 deletions apps/basic-example/src/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import * as React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import {
Gesture,
GestureDetector,
InterceptingGestureDetector,
VirtualGestureDetector,
useTapGesture,
} from 'react-native-gesture-handler';

import { StyleSheet, Text, View } from 'react-native';
import { COLORS } from './colors';

function NativeDetectorExample() {
Expand Down
6 changes: 3 additions & 3 deletions apps/common-app/src/ListWithHeader/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import React, { useEffect } from 'react';
import { Platform, StyleSheet } from 'react-native';
import Animated, {
Easing,
SharedValue,
interpolate,
measure,
useAnimatedRef,
Expand All @@ -11,12 +8,15 @@
useSharedValue,
withTiming,
} from 'react-native-reanimated';
import { Platform, StyleSheet } from 'react-native';
import React, { useEffect } from 'react';
import { COLORS } from '../common';
import type { SharedValue } from 'react-native-reanimated';

// eslint-disable-next-line import-x/no-commonjs, @typescript-eslint/no-var-requires
const SIGNET = require('./signet.png');

Check warning on line 17 in apps/common-app/src/ListWithHeader/Header.tsx

View workflow job for this annotation

GitHub Actions / check (apps/common-app)

Unsafe assignment of an `any` value
// eslint-disable-next-line import-x/no-commonjs, @typescript-eslint/no-var-requires
const TEXT = require('./text.png');

Check warning on line 19 in apps/common-app/src/ListWithHeader/Header.tsx

View workflow job for this annotation

GitHub Actions / check (apps/common-app)

Unsafe assignment of an `any` value

export const HEADER_HEIGHT =
Platform.OS === 'web' || Platform.OS === 'macos' ? 64 : 192;
Expand Down Expand Up @@ -142,7 +142,7 @@
});

useEffect(() => {
setTimeout(() => {

Check warning on line 145 in apps/common-app/src/ListWithHeader/Header.tsx

View workflow job for this annotation

GitHub Actions / check (apps/common-app)

A 'setTimeout' must be assigned to a variable for proper cleanup
isMounted.value = true;
opacity.value = withTiming(1, {
duration: 200,
Expand All @@ -157,11 +157,11 @@
collapsable={false}
style={[headerStyle, styles.nativeHeader]}>
<Animated.Image
source={SIGNET}

Check warning on line 160 in apps/common-app/src/ListWithHeader/Header.tsx

View workflow job for this annotation

GitHub Actions / check (apps/common-app)

Unsafe assignment of an `any` value
style={signetStyle}
resizeMode="contain"
/>
<Animated.Image source={TEXT} style={textStyle} resizeMode="contain" />

Check warning on line 164 in apps/common-app/src/ListWithHeader/Header.tsx

View workflow job for this annotation

GitHub Actions / check (apps/common-app)

Unsafe assignment of an `any` value
</Animated.View>
);
}
Expand All @@ -170,12 +170,12 @@
return (
<Animated.View collapsable={false} style={styles.webHeader}>
<Animated.Image
source={SIGNET}

Check warning on line 173 in apps/common-app/src/ListWithHeader/Header.tsx

View workflow job for this annotation

GitHub Actions / check (apps/common-app)

Unsafe assignment of an `any` value
style={styles.webSignet}
resizeMode="contain"
/>
<Animated.Image
source={TEXT}

Check warning on line 178 in apps/common-app/src/ListWithHeader/Header.tsx

View workflow job for this annotation

GitHub Actions / check (apps/common-app)

Unsafe assignment of an `any` value
style={styles.webText}
resizeMode="contain"
/>
Expand All @@ -186,8 +186,8 @@
function HeaderMacOS(_props: HeaderProps) {
return (
<Animated.View collapsable={false} style={styles.webHeader}>
<Animated.Image source={SIGNET} style={styles.macosSignet} />

Check warning on line 189 in apps/common-app/src/ListWithHeader/Header.tsx

View workflow job for this annotation

GitHub Actions / check (apps/common-app)

Unsafe assignment of an `any` value
<Animated.Image source={TEXT} style={styles.macosText} />

Check warning on line 190 in apps/common-app/src/ListWithHeader/Header.tsx

View workflow job for this annotation

GitHub Actions / check (apps/common-app)

Unsafe assignment of an `any` value
</Animated.View>
);
}
Expand Down
29 changes: 10 additions & 19 deletions apps/common-app/src/ListWithHeader/ListWithHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
import React, { useEffect } from 'react';
import {
Platform,
ScrollViewProps,
SectionList,
SectionListProps,
StyleSheet,
} from 'react-native';
import Animated, {
SharedValue,
runOnJS,
useAnimatedProps,
useAnimatedReaction,
useAnimatedRef,
useAnimatedStyle,
useScrollViewOffset,
useAnimatedReaction,
useSharedValue,
useAnimatedProps,
useAnimatedStyle,
runOnJS,
withSpring,
AnimatedRef,
} from 'react-native-reanimated';
import type { AnimatedRef, SharedValue } from 'react-native-reanimated';
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
import Header, { HEADER_HEIGHT } from './Header';
import {
Gesture,
GestureDetector,
GestureType,
} from 'react-native-gesture-handler';
import { Platform, SectionList, StyleSheet } from 'react-native';
import React, { useEffect } from 'react';
import type { ScrollViewProps, SectionListProps } from 'react-native';
import type { GestureType } from 'react-native-gesture-handler';

const IS_ANDROID = Platform.OS === 'android';

Expand Down
24 changes: 9 additions & 15 deletions apps/common-app/src/common.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
import Animated, {
Easing,
useAnimatedStyle,
useSharedValue,
withTiming,
} from 'react-native-reanimated';
import type { Platform, StyleProp, ViewStyle } from 'react-native';
Comment thread
m-bert marked this conversation as resolved.
import React, {
RefObject,
useCallback,
useEffect,
useImperativeHandle,
useRef,
useState,
} from 'react';
import {
Text,
StyleSheet,
ViewStyle,
StyleProp,
View,
Platform,
} from 'react-native';
import Animated, {
Easing,
useAnimatedStyle,
useSharedValue,
withTiming,
} from 'react-native-reanimated';
import { StyleSheet, Text, View } from 'react-native';
Comment thread
m-bert marked this conversation as resolved.
import type { RefObject } from 'react';

export interface Example {
name: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import { CameraView, useCameraPermissions, CameraViewProps } from 'expo-camera';
import Animated, { useAnimatedProps } from 'react-native-reanimated';
import type { AnimatedRef, SharedValue } from 'react-native-reanimated';
import { Button, StyleSheet, Text, View } from 'react-native';
import Animated, {
SharedValue,
useAnimatedProps,
AnimatedRef,
} from 'react-native-reanimated';
import { CameraView, useCameraPermissions } from 'expo-camera';
import type { CameraViewProps } from 'expo-camera';
import React from 'react';

const AnimatedCameraView = Animated.createAnimatedComponent(CameraView);

Expand All @@ -17,7 +15,7 @@
}

const Camera = ({ ref, ...props }: CameraProps) => {
const [permission, requestPermission] = useCameraPermissions();

Check warning on line 18 in apps/common-app/src/common_assets/AnimatedCameraView/AnimatedCameraView.tsx

View workflow job for this annotation

GitHub Actions / check (apps/common-app)

Unsafe array destructuring of a tuple element with an `any` value

const animatedProps = useAnimatedProps(() => {
return {
Expand Down
2 changes: 1 addition & 1 deletion apps/common-app/src/empty/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import React from 'react';

export default function EmptyExample() {
return (
Expand Down
6 changes: 6 additions & 0 deletions apps/common-app/src/images.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module '*.png' {
import type { ImageSourcePropType } from 'react-native';

const value: ImageSourcePropType;
export default value;
}
7 changes: 4 additions & 3 deletions apps/common-app/src/legacy/basic/bouncing/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React, { Component, PropsWithChildren } from 'react';
import { Animated, StyleSheet, View } from 'react-native';

import {
PanGestureHandler,
RotationGestureHandler,
State,
} from 'react-native-gesture-handler';
import type {
PanGestureHandlerGestureEvent,
PanGestureHandlerStateChangeEvent,
RotationGestureHandlerGestureEvent,
RotationGestureHandlerStateChangeEvent,
} from 'react-native-gesture-handler';

import React, { Component } from 'react';
import type { PropsWithChildren } from 'react';
import { USE_NATIVE_DRIVER } from '../../../config';

class Snappable extends Component<PropsWithChildren<Record<string, unknown>>> {
Expand Down
15 changes: 8 additions & 7 deletions apps/common-app/src/legacy/basic/draggable/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React, { Component } from 'react';
import { Animated, StyleProp, StyleSheet, ViewStyle } from 'react-native';

import { Animated, StyleSheet } from 'react-native';
import {
PanGestureHandler,
ScrollView,
State,
PanGestureHandlerStateChangeEvent,
} from 'react-native-gesture-handler';
import type {
PanGestureHandlerGestureEvent,
ScrollView,
PanGestureHandlerStateChangeEvent,
} from 'react-native-gesture-handler';

import { USE_NATIVE_DRIVER } from '../../../config';
import React, { Component } from 'react';
import type { StyleProp, ViewStyle } from 'react-native';
import { LoremIpsum } from '../../../common';
import { USE_NATIVE_DRIVER } from '../../../config';

type DraggableBoxProps = {
minDist?: number;
Expand Down
16 changes: 8 additions & 8 deletions apps/common-app/src/legacy/basic/fling/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react';
import { StyleSheet, View } from 'react-native';
import Animated, {
Easing,
useAnimatedStyle,
useSharedValue,
withTiming,
} from 'react-native-reanimated';
import {
Directions,
Gesture,
GestureDetector,
} from 'react-native-gesture-handler';
import Animated, {
useSharedValue,
useAnimatedStyle,
withTiming,
Easing,
} from 'react-native-reanimated';
import { StyleSheet, View } from 'react-native';
import React from 'react';

export default function Example() {
const position = useSharedValue(0);
Expand Down
11 changes: 3 additions & 8 deletions apps/common-app/src/legacy/basic/forcetouch/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { Animated, StyleSheet, Text, View } from 'react-native';
import { ForceTouchGestureHandler, State } from 'react-native-gesture-handler';
import React, { Component } from 'react';
import { Animated, StyleSheet, View, Text } from 'react-native';

import {
State,
ForceTouchGestureHandler,
ForceTouchGestureHandlerStateChangeEvent,
} from 'react-native-gesture-handler';

import type { ForceTouchGestureHandlerStateChangeEvent } from 'react-native-gesture-handler';
import { USE_NATIVE_DRIVER } from '../../../config';

export default class Example extends Component {
Expand Down
8 changes: 4 additions & 4 deletions apps/common-app/src/legacy/basic/multitap/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, { Component } from 'react';
import { StyleSheet, View, Text } from 'react-native';

import {
LongPressGestureHandler,
ScrollView,
State,
TapGestureHandler,
} from 'react-native-gesture-handler';
import type {
LongPressGestureHandlerStateChangeEvent,
TapGestureHandlerStateChangeEvent,
} from 'react-native-gesture-handler';

import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { LoremIpsum } from '../../../common';

interface PressBoxProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import ViewPagerAndroid from '@react-native-community/viewpager';
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import {
legacy_createNativeWrapper,
LegacyDrawerLayoutAndroid,
legacy_createNativeWrapper,
} from 'react-native-gesture-handler';
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import ViewPagerAndroid from '@react-native-community/viewpager';

const WrappedViewPagerAndroid = legacy_createNativeWrapper(ViewPagerAndroid, {
disallowInterruption: true,
Expand Down
15 changes: 5 additions & 10 deletions apps/common-app/src/legacy/basic/panResponder/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import React, { Component } from 'react';
import {
StyleSheet,
View,
PanResponder,
I18nManager,
import type {
GestureResponderEvent,
PanResponderGestureState,
GestureResponderHandlers,
PanResponderGestureState,
} from 'react-native';

import { ScrollView } from 'react-native-gesture-handler';

import { I18nManager, PanResponder, StyleSheet, View } from 'react-native';
import React, { Component } from 'react';
import { DraggableBox } from '../draggable';
import { LoremIpsum } from '../../../common';
import { ScrollView } from 'react-native-gesture-handler';

const CIRCLE_SIZE = 80;

Expand Down
Loading
Loading