run yarn lint --fix (#9013)

This commit is contained in:
Samuel Newman
2025-09-09 18:38:21 +03:00
committed by GitHub
parent bb30b592d7
commit 53e43a957c
225 changed files with 555 additions and 433 deletions
@@ -1,5 +1,5 @@
import React from 'react'
import {View} from 'react-native'
import type React from 'react'
import {MAX_ALT_TEXT} from '#/lib/constants'
import {CharProgress} from '#/view/com/composer/char-progress/CharProgress'
+1 -1
View File
@@ -1,7 +1,7 @@
import React from 'react'
import {View} from 'react-native'
import {KeyboardStickyView} from 'react-native-keyboard-controller'
import {useSafeAreaInsets} from 'react-native-safe-area-context'
import type React from 'react'
import {isWeb} from '#/platform/detection'
import {atoms as a, useTheme} from '#/alf'
@@ -1,4 +1,9 @@
import {StyleProp, TextStyle, View, ViewStyle} from 'react-native'
import {
type StyleProp,
type TextStyle,
View,
type ViewStyle,
} from 'react-native'
// @ts-ignore no type definition -prf
import ProgressCircle from 'react-native-progress/Circle'
// @ts-ignore no type definition -prf
@@ -4,7 +4,7 @@ import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {logEvent} from '#/lib/statsig/statsig'
import {Gif} from '#/state/queries/tenor'
import {type Gif} from '#/state/queries/tenor'
import {atoms as a, useTheme} from '#/alf'
import {Button} from '#/components/Button'
import {GifSelectDialog} from '#/components/dialogs/GifSelect'
@@ -1,4 +1,4 @@
import {AppBskyRichtextFacet, RichText} from '@atproto/api'
import {type AppBskyRichtextFacet, type RichText} from '@atproto/api'
export type LinkFacetMatch = {
rt: RichText
@@ -16,7 +16,7 @@
import {URL_REGEX} from '@atproto/api'
import {Mark} from '@tiptap/core'
import {Node as ProsemirrorNode} from '@tiptap/pm/model'
import {type Node as ProsemirrorNode} from '@tiptap/pm/model'
import {Plugin, PluginKey} from '@tiptap/pm/state'
import {Decoration, DecorationSet} from '@tiptap/pm/view'
@@ -16,7 +16,7 @@
import {TAG_REGEX, TRAILING_PUNCTUATION_REGEX} from '@atproto/api'
import {Mark} from '@tiptap/core'
import {Node as ProsemirrorNode} from '@tiptap/pm/model'
import {type Node as ProsemirrorNode} from '@tiptap/pm/model'
import {Plugin, PluginKey} from '@tiptap/pm/state'
import {Decoration, DecorationSet} from '@tiptap/pm/view'
@@ -1,11 +1,11 @@
import {Keyboard, StyleProp, ViewStyle} from 'react-native'
import {AnimatedStyle} from 'react-native-reanimated'
import {AppBskyFeedPostgate} from '@atproto/api'
import {Keyboard, type StyleProp, type ViewStyle} from 'react-native'
import {type AnimatedStyle} from 'react-native-reanimated'
import {type AppBskyFeedPostgate} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {isNative} from '#/platform/detection'
import {ThreadgateAllowUISetting} from '#/state/queries/threadgate'
import {type ThreadgateAllowUISetting} from '#/state/queries/threadgate'
import {native} from '#/alf'
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
import * as Dialog from '#/components/Dialog'
@@ -1,7 +1,8 @@
import React, {useRef} from 'react'
import {useRef} from 'react'
import {View} from 'react-native'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import type React from 'react'
import {logger} from '#/logger'
import * as Toast from '#/view/com/util/Toast'
@@ -1,9 +1,9 @@
import {View} from 'react-native'
import {ImagePickerAsset} from 'expo-image-picker'
import {type ImagePickerAsset} from 'expo-image-picker'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {CompressedVideo} from '#/lib/media/video/types'
import {type CompressedVideo} from '#/lib/media/video/types'
import {clamp} from '#/lib/numbers'
import {useAutoplayDisabled} from '#/state/preferences'
import {ExternalEmbedRemoveBtn} from '#/view/com/composer/ExternalEmbedRemoveBtn'
@@ -1,7 +1,7 @@
import {View} from 'react-native'
// @ts-expect-error no type definition
import ProgressPie from 'react-native-progress/Pie'
import {ImagePickerAsset} from 'expo-image-picker'
import {type ImagePickerAsset} from 'expo-image-picker'
import {clamp} from '#/lib/numbers'
import {isWeb} from '#/platform/detection'
@@ -1,4 +1,4 @@
import {ImagePickerAsset, ImagePickerResult} from 'expo-image-picker'
import {type ImagePickerAsset, type ImagePickerResult} from 'expo-image-picker'
import {SUPPORTED_MIME_TYPES} from '#/lib/constants'
@@ -6,8 +6,8 @@
*
*/
import {TransformsStyle} from 'react-native'
import {MeasuredDimensions} from 'react-native-reanimated'
import {type TransformsStyle} from 'react-native'
import {type MeasuredDimensions} from 'react-native-reanimated'
export type Dimensions = {
width: number
@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*
*/
import {StyleSheet, TouchableOpacity, ViewStyle} from 'react-native'
import {StyleSheet, TouchableOpacity, type ViewStyle} from 'react-native'
import {SafeAreaView} from 'react-native-safe-area-context'
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
import {msg} from '@lingui/macro'
@@ -3,11 +3,11 @@ import {ActivityIndicator, StyleSheet} from 'react-native'
import {
Gesture,
GestureDetector,
PanGesture,
type PanGesture,
} from 'react-native-gesture-handler'
import Animated, {
runOnJS,
SharedValue,
type SharedValue,
useAnimatedReaction,
useAnimatedRef,
useAnimatedStyle,
@@ -16,10 +16,10 @@ import Animated, {
} from 'react-native-reanimated'
import {Image} from 'expo-image'
import type {
Dimensions as ImageDimensions,
ImageSource,
Transform,
import {
type Dimensions as ImageDimensions,
type ImageSource,
type Transform,
} from '../../@types'
import {
applyRounding,
@@ -28,7 +28,7 @@ import {
prependPinch,
prependTransform,
readTransform,
TransformMatrix,
type TransformMatrix,
} from '../../transforms'
const MIN_SCREEN_ZOOM = 2
@@ -11,11 +11,11 @@ import {ActivityIndicator, StyleSheet} from 'react-native'
import {
Gesture,
GestureDetector,
PanGesture,
type PanGesture,
} from 'react-native-gesture-handler'
import Animated, {
runOnJS,
SharedValue,
type SharedValue,
useAnimatedProps,
useAnimatedReaction,
useAnimatedRef,
@@ -27,9 +27,9 @@ import {Image} from 'expo-image'
import {useAnimatedScrollHandler} from '#/lib/hooks/useAnimatedScrollHandler_FIXED'
import {
Dimensions as ImageDimensions,
ImageSource,
Transform,
type Dimensions as ImageDimensions,
type ImageSource,
type Transform,
} from '../../@types'
const MAX_ORIGINAL_IMAGE_ZOOM = 2
@@ -2,14 +2,14 @@
import React from 'react'
import {View} from 'react-native'
import {PanGesture} from 'react-native-gesture-handler'
import {SharedValue} from 'react-native-reanimated'
import {type PanGesture} from 'react-native-gesture-handler'
import {type SharedValue} from 'react-native-reanimated'
import {Dimensions} from '#/lib/media/types'
import {type Dimensions} from '#/lib/media/types'
import {
Dimensions as ImageDimensions,
ImageSource,
Transform,
type Dimensions as ImageDimensions,
type ImageSource,
type Transform,
} from '../../@types'
type Props = {
@@ -1,4 +1,4 @@
import type {Position} from './@types'
import {type Position} from './@types'
export type TransformMatrix = [
number,
+3 -3
View File
@@ -6,10 +6,10 @@ import {
View,
} from 'react-native'
import {setStringAsync} from 'expo-clipboard'
import {ComAtprotoServerDefs} from '@atproto/api'
import {type ComAtprotoServerDefs} from '@atproto/api'
import {
FontAwesomeIcon,
FontAwesomeIconStyle,
type FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
@@ -22,7 +22,7 @@ import {isWeb} from '#/platform/detection'
import {useInvitesAPI, useInvitesState} from '#/state/invites'
import {useModalControls} from '#/state/modals'
import {
InviteCodesQueryResponse,
type InviteCodesQueryResponse,
useInviteCodesQuery,
} from '#/state/queries/invites'
import {ErrorMessage} from '../util/error/ErrorMessage'
+2 -2
View File
@@ -5,7 +5,7 @@ import {
useWindowDimensions,
View,
} from 'react-native'
import {AppBskyGraphDefs as GraphDefs} from '@atproto/api'
import {type AppBskyGraphDefs as GraphDefs} from '@atproto/api'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
@@ -18,7 +18,7 @@ import {isAndroid, isMobileWeb, isWeb} from '#/platform/detection'
import {useModalControls} from '#/state/modals'
import {
getMembership,
ListMembersip,
type ListMembersip,
useDangerousListMembershipsQuery,
useListMembershipAddMutation,
useListMembershipRemoveMutation,
+1 -1
View File
@@ -1,5 +1,5 @@
import {useCallback, useMemo, useState} from 'react'
import {AppBskyFeedGetLikes as GetLikes} from '@atproto/api'
import {type AppBskyFeedGetLikes as GetLikes} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
+2 -2
View File
@@ -1,9 +1,9 @@
import {useCallback, useState} from 'react'
import {
AppBskyFeedDefs,
type AppBskyFeedDefs,
AppBskyFeedPost,
moderatePost,
ModerationDecision,
type ModerationDecision,
} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
+1 -1
View File
@@ -1,5 +1,5 @@
import {useCallback, useMemo, useState} from 'react'
import {AppBskyActorDefs as ActorDefs} from '@atproto/api'
import {type AppBskyActorDefs as ActorDefs} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
+2 -2
View File
@@ -2,14 +2,14 @@ import React from 'react'
import {StyleSheet, View} from 'react-native'
import {
FontAwesomeIcon,
FontAwesomeIconStyle,
type FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome'
import {Trans} from '@lingui/macro'
import {useNavigation} from '@react-navigation/native'
import {usePalette} from '#/lib/hooks/usePalette'
import {MagnifyingGlassIcon} from '#/lib/icons'
import {NavigationProp} from '#/lib/routes/types'
import {type NavigationProp} from '#/lib/routes/types'
import {s} from '#/lib/styles'
import {isWeb} from '#/platform/detection'
import {Button} from '../util/forms/Button'
+2 -2
View File
@@ -2,14 +2,14 @@ import React from 'react'
import {StyleSheet, View} from 'react-native'
import {
FontAwesomeIcon,
FontAwesomeIconStyle,
type FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome'
import {Trans} from '@lingui/macro'
import {useNavigation} from '@react-navigation/native'
import {usePalette} from '#/lib/hooks/usePalette'
import {MagnifyingGlassIcon} from '#/lib/icons'
import {NavigationProp} from '#/lib/routes/types'
import {type NavigationProp} from '#/lib/routes/types'
import {s} from '#/lib/styles'
import {isWeb} from '#/platform/detection'
import {Button} from '../util/forms/Button'
+2 -2
View File
@@ -2,13 +2,13 @@ import React from 'react'
import {Dimensions, StyleSheet, View} from 'react-native'
import {
FontAwesomeIcon,
FontAwesomeIconStyle,
type FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome'
import {Trans} from '@lingui/macro'
import {useNavigation} from '@react-navigation/native'
import {usePalette} from '#/lib/hooks/usePalette'
import {NavigationProp} from '#/lib/routes/types'
import {type NavigationProp} from '#/lib/routes/types'
import {s} from '#/lib/styles'
import {isWeb} from '#/platform/detection'
import {Button} from '../util/forms/Button'
+1 -1
View File
@@ -1,5 +1,5 @@
import React from 'react'
import {AppBskyActorDefs as ActorDefs} from '@atproto/api'
import {type AppBskyActorDefs as ActorDefs} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
+1 -1
View File
@@ -1,5 +1,5 @@
import React from 'react'
import {AppBskyActorDefs as ActorDefs} from '@atproto/api'
import {type AppBskyActorDefs as ActorDefs} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
+1 -1
View File
@@ -1,4 +1,4 @@
import {AlertButton, AlertStatic} from 'react-native'
import {type AlertButton, type AlertStatic} from 'react-native'
class WebAlert implements Pick<AlertStatic, 'alert'> {
public alert(title: string, message?: string, buttons?: AlertButton[]): void {
@@ -1,13 +1,14 @@
import React, {useMemo} from 'react'
import {useMemo} from 'react'
import {TouchableWithoutFeedback} from 'react-native'
import Animated, {
Extrapolation,
interpolate,
useAnimatedStyle,
} from 'react-native-reanimated'
import {BottomSheetBackdropProps} from '@discord/bottom-sheet/src'
import {type BottomSheetBackdropProps} from '@discord/bottom-sheet/src'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import type React from 'react'
export function createCustomBackdrop(
onClose?: (() => void) | undefined,
+3 -3
View File
@@ -1,8 +1,8 @@
import {StyleProp, StyleSheet, View, ViewStyle} from 'react-native'
import {IconProp} from '@fortawesome/fontawesome-svg-core'
import {type StyleProp, StyleSheet, View, type ViewStyle} from 'react-native'
import {type IconProp} from '@fortawesome/fontawesome-svg-core'
import {
FontAwesomeIcon,
FontAwesomeIconStyle,
type FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome'
import {usePalette} from '#/lib/hooks/usePalette'
+2 -2
View File
@@ -1,8 +1,8 @@
import {StyleSheet, View} from 'react-native'
import {IconProp} from '@fortawesome/fontawesome-svg-core'
import {type IconProp} from '@fortawesome/fontawesome-svg-core'
import {
FontAwesomeIcon,
FontAwesomeIconStyle,
type FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome'
import {usePalette} from '#/lib/hooks/usePalette'
+2 -2
View File
@@ -1,5 +1,5 @@
import {Component, ErrorInfo, ReactNode} from 'react'
import {StyleProp, ViewStyle} from 'react-native'
import {Component, type ErrorInfo, type ReactNode} from 'react'
import {type StyleProp, type ViewStyle} from 'react-native'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
+2 -2
View File
@@ -1,7 +1,7 @@
import {StyleProp, StyleSheet, TextStyle} from 'react-native'
import {type StyleProp, StyleSheet, type TextStyle} from 'react-native'
import {sanitizeDisplayName} from '#/lib/strings/display-names'
import {TypographyVariant} from '#/lib/ThemeContext'
import {type TypographyVariant} from '#/lib/ThemeContext'
import {useFeedSourceInfoQuery} from '#/state/queries/feed'
import {TextLinkOnWebOnly} from './Link'
import {LoadingPlaceholder} from './LoadingPlaceholder'
+1 -1
View File
@@ -1,7 +1,7 @@
import {StyleSheet} from 'react-native'
import {
FontAwesomeIcon,
FontAwesomeIconStyle,
type FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome'
import {usePalette} from '#/lib/hooks/usePalette'
+1 -1
View File
@@ -1,5 +1,5 @@
import React, {useCallback, useEffect} from 'react'
import {NativeScrollEvent} from 'react-native'
import {type NativeScrollEvent} from 'react-native'
import {interpolate, useSharedValue, withSpring} from 'react-native-reanimated'
import EventEmitter from 'eventemitter3'
+8 -3
View File
@@ -1,6 +1,11 @@
import {forwardRef, PropsWithChildren} from 'react'
import {Pressable, PressableProps, StyleProp, ViewStyle} from 'react-native'
import {View} from 'react-native'
import {forwardRef, type PropsWithChildren} from 'react'
import {
Pressable,
type PressableProps,
type StyleProp,
type ViewStyle,
} from 'react-native'
import {type View} from 'react-native'
import {addStyle} from '#/lib/styles'
import {useInteractionState} from '#/components/hooks/useInteractionState'
+3 -3
View File
@@ -1,8 +1,8 @@
import {forwardRef} from 'react'
import {FlatListComponent} from 'react-native'
import {View, ViewProps} from 'react-native'
import {type FlatListComponent} from 'react-native'
import {View, type ViewProps} from 'react-native'
import Animated from 'react-native-reanimated'
import {FlatListPropsWithLayout} from 'react-native-reanimated'
import {type FlatListPropsWithLayout} from 'react-native-reanimated'
// If you explode these into functions, don't forget to forwardRef!
+1 -1
View File
@@ -1,5 +1,5 @@
import React from 'react'
import {Platform} from 'react-native'
import type React from 'react'
const onMouseUp = (e: React.MouseEvent & {target: HTMLElement}) => {
// Only handle whenever it is the middle button
+3 -3
View File
@@ -1,13 +1,13 @@
import {
StyleProp,
type StyleProp,
StyleSheet,
TouchableOpacity,
View,
ViewStyle,
type ViewStyle,
} from 'react-native'
import {
FontAwesomeIcon,
FontAwesomeIconStyle,
type FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
+1 -1
View File
@@ -1,7 +1,7 @@
import {View} from 'react-native'
import {
FontAwesomeIcon,
FontAwesomeIconStyle,
type FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
+1 -1
View File
@@ -1,7 +1,7 @@
import {View} from 'react-native'
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
import {FABInner, FABProps} from './FABInner'
import {FABInner, type FABProps} from './FABInner'
export const FAB = (_opts: FABProps) => {
const {isDesktop} = useWebMediaQueries()
+1 -1
View File
@@ -1,4 +1,4 @@
import {Image, ImageProps, ImageSource} from 'expo-image'
import {Image, type ImageProps, type ImageSource} from 'expo-image'
interface HighPriorityImageProps extends ImageProps {
source: ImageSource
@@ -1,5 +1,5 @@
import React from 'react'
import {ScrollView, StyleSheet, View} from 'react-native'
import type React from 'react'
import {useColorSchemeStyle} from '#/lib/hooks/useColorSchemeStyle'
import {useIsKeyboardVisible} from '#/lib/hooks/useIsKeyboardVisible'