replace ts ignores with expect errors

This commit is contained in:
Samuel Newman
2026-08-13 11:54:52 +03:00
parent 8677387c23
commit 690219692a
60 changed files with 64 additions and 113 deletions
+2 -2
View File
@@ -1006,7 +1006,7 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
ax.metric('init', { ax.metric('init', {
initMs: Math.round( initMs: Math.round(
// @ts-ignore Emitted by Metro in the bundle prelude // @ts-expect-error Emitted by Metro in the bundle prelude
performance.now() - global.__BUNDLE_START_TIME__, performance.now() - global.__BUNDLE_START_TIME__,
), ),
}) })
@@ -1081,7 +1081,7 @@ function navigate<K extends keyof AllNavigatorParams>(
} }
navigationRef.addListener('state', handler) navigationRef.addListener('state', handler)
// @ts-ignore I don't know what would make typescript happy but I have a life -prf // @ts-expect-error I don't know what would make typescript happy but I have a life -prf
navigationRef.navigate(name, params) navigationRef.navigate(name, params)
}), }),
timeout(1e3), timeout(1e3),
+3 -3
View File
@@ -20,9 +20,9 @@ import * as SplashScreen from 'expo-splash-screen'
import {Logotype} from '#/view/icons/Logotype' import {Logotype} from '#/view/icons/Logotype'
import {atoms as a} from '#/alf' import {atoms as a} from '#/alf'
// @ts-ignore // @ts-expect-error
import splashImagePointer from '../assets/splash/splash.png' import splashImagePointer from '../assets/splash/splash.png'
// @ts-ignore // @ts-expect-error
import darkSplashImagePointer from '../assets/splash/splash-dark.png' import darkSplashImagePointer from '../assets/splash/splash-dark.png'
const splashImageUri = RNImage.resolveAssetSource(splashImagePointer)!.uri const splashImageUri = RNImage.resolveAssetSource(splashImagePointer)!.uri
@@ -36,7 +36,7 @@ export const Logo = forwardRef(function LogoImpl(props: SvgProps, ref) {
return ( return (
<Svg <Svg
fill="none" fill="none"
// @ts-ignore it's fiiiiine // @ts-expect-error it's fiiiiine
ref={ref} ref={ref}
viewBox="0 0 64 66" viewBox="0 0 64 66"
style={[{width, height}, props.style]}> style={[{width, height}, props.style]}>
@@ -149,7 +149,6 @@ export function RedirectOverlay() {
t.atoms.bg, t.atoms.bg,
gtMobile ? a.p_2xl : a.p_xl, gtMobile ? a.p_2xl : a.p_xl,
a.align_center, a.align_center,
// @ts-ignore
platform({ platform({
web: { web: {
paddingTop: '35vh', paddingTop: '35vh',
-3
View File
@@ -39,11 +39,8 @@ function getThemeName(
} }
function updateDocument(theme: ThemeName) { function updateDocument(theme: ThemeName) {
// @ts-ignore web only
if (IS_WEB && typeof window !== 'undefined') { if (IS_WEB && typeof window !== 'undefined') {
// @ts-ignore web only
const html = window.document.documentElement const html = window.document.documentElement
// @ts-ignore web only
const meta = window.document.querySelector('meta[name="theme-color"]') const meta = window.document.querySelector('meta[name="theme-color"]')
// remove any other color mode classes // remove any other color mode classes
+1 -1
View File
@@ -14,7 +14,7 @@ import {
export function useMeta(metadata?: MergeableMetadata) { export function useMeta(metadata?: MergeableMetadata) {
const m = useMemo(() => metadata, [metadata]) const m = useMemo(() => metadata, [metadata])
if (!m) return if (!m) return
// @ts-ignore // @ts-expect-error
m.__meta = true m.__meta = true
return m return m
} }
-1
View File
@@ -577,7 +577,6 @@ export const Button = forwardRef<React.ComponentRef<typeof View>, ButtonProps>(
role="button" role="button"
accessibilityHint={undefined} // optional accessibilityHint={undefined} // optional
{...rest} {...rest}
// @ts-ignore - this will always be a pressable
ref={ref} ref={ref}
aria-label={label} aria-label={label}
aria-pressed={state.pressed} aria-pressed={state.pressed}
+2 -3
View File
@@ -314,7 +314,7 @@ export function Composer({
style={[a.absolute, a.inset_0, a.z_10, {overflow: 'hidden'}]} style={[a.absolute, a.inset_0, a.z_10, {overflow: 'hidden'}]}
ref={node => { ref={node => {
if (IS_WEB && node) { if (IS_WEB && node) {
// @ts-ignore web only a11y // @ts-expect-error web only a11y
node.setAttribute('inert', '') node.setAttribute('inert', '')
} }
}}> }}>
@@ -367,11 +367,10 @@ export function Composer({
inputScrollSharedValue.value = e.nativeEvent.contentOffset.y inputScrollSharedValue.value = e.nativeEvent.contentOffset.y
} }
}} }}
// @ts-ignore web only // @ts-expect-error web only
onCompositionStart={() => { onCompositionStart={() => {
isComposing.current = true isComposing.current = true
}} }}
// @ts-ignore web only
onCompositionEnd={() => { onCompositionEnd={() => {
isComposing.current = false isComposing.current = false
}} }}
+1 -1
View File
@@ -712,7 +712,7 @@ export function Outer({
t.atoms.bg_contrast_25, t.atoms.bg_contrast_25,
a.w_full, a.w_full,
// @ts-ignore react-native-web expects string, and this file is platform-split -sfn // @ts-ignore react-native-web expects string, and this file is platform-split -sfn
// note: above @ts-ignore cannot be a @ts-expect-error because this does not cause an error // note: above @ts-expect-error cannot be a @ts-expect-error because this does not cause an error
// in the typecheck CI - presumably because of RNW overriding the types // in the typecheck CI - presumably because of RNW overriding the types
{ {
transformOrigin: transformOrigin:
+1 -1
View File
@@ -276,7 +276,7 @@ export function ProfileGrid({
}, },
{threshold: 0.5}, {threshold: 0.5},
) )
// @ts-ignore - web only // @ts-expect-error - web only
observer.observe(node) observer.observe(node)
return () => observer.disconnect() return () => observer.disconnect()
} else { } else {
-3
View File
@@ -446,9 +446,7 @@ function LightboxGalleryItem({
const styles = StyleSheet.create({ const styles = StyleSheet.create({
avi: { avi: {
// @ts-ignore web-only
maxWidth: `calc(min(400px, 100vw))`, maxWidth: `calc(min(400px, 100vw))`,
// @ts-ignore web-only
maxHeight: `calc(min(400px, 100vh))`, maxHeight: `calc(min(400px, 100vh))`,
padding: 16, padding: 16,
boxSizing: 'border-box', boxSizing: 'border-box',
@@ -458,7 +456,6 @@ const styles = StyleSheet.create({
// column via ScrollView's default flexGrow. // column via ScrollView's default flexGrow.
flexGrow: 0, flexGrow: 0,
flexShrink: 0, flexShrink: 0,
// @ts-ignore web-only -sfn
maxHeight: '50vh', maxHeight: '50vh',
}, },
menuBtn: { menuBtn: {
@@ -109,7 +109,6 @@ const ImageItem = ({
height: number height: number
}) { }) {
const scrollResponderRef = scrollViewRef?.current?.getScrollResponder() const scrollResponderRef = scrollViewRef?.current?.getScrollResponder()
// @ts-ignore
scrollResponderRef?.scrollResponderZoomTo({ scrollResponderRef?.scrollResponderZoomTo({
...nextZoomRect, // This rect is in screen coordinates ...nextZoomRect, // This rect is in screen coordinates
animated: true, animated: true,
@@ -218,7 +217,6 @@ const ImageItem = ({
return ( return (
<GestureDetector gesture={composedGesture}> <GestureDetector gesture={composedGesture}>
<Animated.ScrollView <Animated.ScrollView
// @ts-ignore Something's up with the types here
ref={scrollViewRef} ref={scrollViewRef}
pinchGestureEnabled pinchGestureEnabled
showsHorizontalScrollIndicator={false} showsHorizontalScrollIndicator={false}
@@ -149,7 +149,7 @@ function canPlayBskyVideoCodecs(): boolean {
type CachedPromise<T> = Promise<T> & {value: undefined | T} type CachedPromise<T> = Promise<T> & {value: undefined | T}
const promiseForHls = import( const promiseForHls = import(
// @ts-ignore // @ts-expect-error
'hls.js/dist/hls.min' 'hls.js/dist/hls.min'
// oxlint-disable-next-line typescript/no-unsafe-member-access // oxlint-disable-next-line typescript/no-unsafe-member-access
).then(mod => mod.default) as CachedPromise<typeof HlsTypes.default> ).then(mod => mod.default) as CachedPromise<typeof HlsTypes.default>
@@ -318,11 +318,10 @@ export function ProfileHoverCardInner(props: ProfileHoverCardProps) {
return ( return (
<View <View
// @ts-ignore View is being used as div
ref={refs.setReference} ref={refs.setReference}
onPointerMove={onPointerMoveTarget} onPointerMove={onPointerMoveTarget}
onPointerLeave={onPointerLeaveTarget} onPointerLeave={onPointerLeaveTarget}
// @ts-ignore web only prop // @ts-expect-error web only prop
onMouseUp={onPress} onMouseUp={onPress}
style={[a.flex_shrink, props.inline && a.inline]}> style={[a.flex_shrink, props.inline && a.inline]}>
{props.children} {props.children}
+2 -5
View File
@@ -104,7 +104,6 @@ export function RichText({
style={[plainStyles, {fontSize}, suffixStyles]} style={[plainStyles, {fontSize}, suffixStyles]}
onLayout={onLayout} onLayout={onLayout}
onTextLayout={onTextLayout} onTextLayout={onTextLayout}
// @ts-ignore web only -prf
dataSet={WORD_WRAP}> dataSet={WORD_WRAP}>
{text} {text}
{suffix ? ' ' : null} {suffix ? ' ' : null}
@@ -121,7 +120,6 @@ export function RichText({
numberOfLines={numberOfLines} numberOfLines={numberOfLines}
onLayout={onLayout} onLayout={onLayout}
onTextLayout={onTextLayout} onTextLayout={onTextLayout}
// @ts-ignore web only -prf
dataSet={WORD_WRAP}> dataSet={WORD_WRAP}>
{text} {text}
{suffix ? ' ' : null} {suffix ? ' ' : null}
@@ -150,7 +148,7 @@ export function RichText({
selectable={selectable} selectable={selectable}
to={`/profile/${mention.did}`} to={`/profile/${mention.did}`}
style={interactiveStyles} style={interactiveStyles}
// @ts-ignore TODO // @ts-expect-error TODO
dataSet={WORD_WRAP} dataSet={WORD_WRAP}
shouldProxy={shouldProxyLinks} shouldProxy={shouldProxyLinks}
onPress={onLinkPress}> onPress={onLinkPress}>
@@ -169,7 +167,7 @@ export function RichText({
key={key} key={key}
to={link.uri} to={link.uri}
style={interactiveStyles} style={interactiveStyles}
// @ts-ignore TODO // @ts-expect-error TODO
dataSet={WORD_WRAP} dataSet={WORD_WRAP}
shareOnLongPress shareOnLongPress
shouldProxy={shouldProxyLinks} shouldProxy={shouldProxyLinks}
@@ -209,7 +207,6 @@ export function RichText({
numberOfLines={numberOfLines} numberOfLines={numberOfLines}
onLayout={onLayout} onLayout={onLayout}
onTextLayout={onTextLayout} onTextLayout={onTextLayout}
// @ts-ignore web only -prf
dataSet={WORD_WRAP}> dataSet={WORD_WRAP}>
{els} {els}
{suffix ? ' ' : null} {suffix ? ' ' : null}
+1 -1
View File
@@ -117,7 +117,7 @@ function Inner({
}, [activeNux, setActiveNux]) }, [activeNux, setActiveNux])
if (__DEV__ && typeof window !== 'undefined') { if (__DEV__ && typeof window !== 'undefined') {
// @ts-ignore // @ts-expect-error
window.clearNuxDialog = (id: Nux) => { window.clearNuxDialog = (id: Nux) => {
if (!__DEV__ || !id) return if (!__DEV__ || !id) return
resetNuxs([id]) resetNuxs([id])
@@ -38,7 +38,6 @@ export function UserSearchInput({
fill={interacted ? t.palette.primary_500 : t.palette.contrast_300} fill={interacted ? t.palette.primary_500 : t.palette.contrast_300}
/> />
<TextInput <TextInput
// @ts-ignore bottom sheet input types issue - esb
ref={inputRef} ref={inputRef}
placeholder={l`Search for people`} placeholder={l`Search for people`}
value={value} value={value}
@@ -93,7 +93,6 @@ export function DateField({
open open
timeZoneOffsetInMinutes={0} timeZoneOffsetInMinutes={0}
theme={t.scheme} theme={t.scheme}
// @ts-ignore TODO
buttonColor={t.name === 'light' ? '#000000' : '#ffffff'} buttonColor={t.name === 'light' ? '#000000' : '#ffffff'}
date={initialDate} date={initialDate}
onConfirm={onChangeInternal} onConfirm={onChangeInternal}
-4
View File
@@ -245,12 +245,8 @@ export function createInput(Component: typeof TextInput) {
applyFonts(flattened, fonts.family) applyFonts(flattened, fonts.family)
// should always be defined on `typography`
// @ts-ignore
if (flattened.fontSize) { if (flattened.fontSize) {
// @ts-ignore
flattened.fontSize = Math.round( flattened.fontSize = Math.round(
// @ts-ignore
flattened.fontSize * fonts.scaleMultiplier, flattened.fontSize * fonts.scaleMultiplier,
) )
} }
+1 -1
View File
@@ -23,7 +23,7 @@ export const IconTemplate_Stroke2_Corner0_Rounded = forwardRef(
<Svg <Svg
fill="none" fill="none"
{...rest} {...rest}
// @ts-ignore it's fiiiiine // @ts-expect-error it's fiiiiine
ref={ref} ref={ref}
viewBox="0 0 24 24" viewBox="0 0 24 24"
width={size} width={size}
+1 -1
View File
@@ -43,7 +43,7 @@ function useWebOnlyDebugLiveEventPreferences() {
useEffect(() => { useEffect(() => {
if (env.IS_DEV && IS_WEB && typeof window !== 'undefined') { if (env.IS_DEV && IS_WEB && typeof window !== 'undefined') {
// @ts-ignore // @ts-expect-error
window.__updateLiveEventPreferences = async ( window.__updateLiveEventPreferences = async (
action: LiveEventPreferencesAction, action: LiveEventPreferencesAction,
) => { ) => {
+1 -1
View File
@@ -334,7 +334,7 @@ class MergeFeedSource_Custom extends MergeFeedSource {
feed = feed.filter(post => new Date(post.post.indexedAt) > this.minDate) feed = feed.filter(post => new Date(post.post.indexedAt) > this.minDate)
// attach source info // attach source info
for (const post of feed) { for (const post of feed) {
// @ts-ignore // @ts-expect-error
post.__source = this.sourceInfo post.__source = this.sourceInfo
} }
return { return {
+1 -1
View File
@@ -24,6 +24,6 @@ export function isJwtExpired(token: string) {
export function isAppPassword(token: string) { export function isAppPassword(token: string) {
const payload = jwtDecode(token) const payload = jwtDecode(token)
// @ts-ignore // @ts-expect-error
return payload.scope === 'com.atproto.appPass' return payload.scope === 'com.atproto.appPass'
} }
+2 -6
View File
@@ -5,8 +5,7 @@ import {IS_WEB} from '#/env'
const {height: SCREEN_HEIGHT} = Dimensions.get('window') const {height: SCREEN_HEIGHT} = Dimensions.get('window')
const IFRAME_HOST = IS_WEB const IFRAME_HOST = IS_WEB
? // @ts-ignore only for web ? window.location.host === 'localhost:8100'
window.location.host === 'localhost:8100'
? 'http://localhost:8100' ? 'http://localhost:8100'
: 'https://bsky.app' : 'https://bsky.app'
: __DEV__ && !process.env.JEST_WORKER_ID : __DEV__ && !process.env.JEST_WORKER_ID
@@ -154,10 +153,7 @@ export function parseEmbedPlayerFromUrl(
urlp.hostname === 'www.twitch.tv' || urlp.hostname === 'www.twitch.tv' ||
urlp.hostname === 'm.twitch.tv' urlp.hostname === 'm.twitch.tv'
) { ) {
const parent = IS_WEB const parent = IS_WEB ? window.location.hostname : 'localhost'
? // @ts-ignore only for web
window.location.hostname
: 'localhost'
const [__, channelOrVideo, clipOrId, id] = urlp.pathname.split('/') const [__, channelOrVideo, clipOrId, id] = urlp.pathname.split('/')
+1 -1
View File
@@ -57,7 +57,7 @@ export function getLocales() {
} }
} }
// @ts-ignore checked above // @ts-expect-error checked above
output.push(locale) output.push(locale)
} }
+3 -3
View File
@@ -366,7 +366,7 @@ describe('debug contexts', () => {
const timestamp = Date.now() const timestamp = Date.now()
const message = nanoid() const message = nanoid()
const logger = new Logger({ const logger = new Logger({
// @ts-ignore // @ts-expect-error
context: 'specific', context: 'specific',
level: LogLevel.Debug, level: LogLevel.Debug,
}) })
@@ -388,7 +388,7 @@ describe('debug contexts', () => {
const timestamp = Date.now() const timestamp = Date.now()
const message = nanoid() const message = nanoid()
const logger = new Logger({ const logger = new Logger({
// @ts-ignore // @ts-expect-error
context: 'namespace:foo', context: 'namespace:foo',
contextFilter: 'namespace:*', contextFilter: 'namespace:*',
level: LogLevel.Debug, level: LogLevel.Debug,
@@ -411,7 +411,7 @@ describe('debug contexts', () => {
const timestamp = Date.now() const timestamp = Date.now()
const message = nanoid() const message = nanoid()
const logger = new Logger({ const logger = new Logger({
// @ts-ignore // @ts-expect-error
context: 'namespace:bar:baz', context: 'namespace:bar:baz',
contextFilter: 'namespace:foo:*', contextFilter: 'namespace:foo:*',
}) })
+1 -1
View File
@@ -1,2 +1,2 @@
// @ts-ignore Web-only. On RN, this is set by Metro. // @ts-expect-error Web-only. On RN, this is set by Metro.
window.__BUNDLE_START_TIME__ = performance.now() window.__BUNDLE_START_TIME__ = performance.now()
-1
View File
@@ -271,7 +271,6 @@ function HashtagScreenTab({
onEndReached={onEndReached} onEndReached={onEndReached}
onEndReachedThreshold={4} onEndReachedThreshold={4}
onItemSeen={trackPostView} onItemSeen={trackPostView}
// @ts-ignore web only -prf
desktopFixedHeight desktopFixedHeight
ListFooterComponent={ ListFooterComponent={
<ListFooter <ListFooter
@@ -52,7 +52,6 @@ export const PlaceholderCanvas = forwardRef<PlaceholderCanvasRef, {}>(
<View style={styles.container}> <View style={styles.container}>
<Suspense fallback={null}> <Suspense fallback={null}>
<LazyViewShot <LazyViewShot
// @ts-ignore this library doesn't have types
ref={viewshotRef} ref={viewshotRef}
options={{ options={{
fileName: 'placeholderAvatar', fileName: 'placeholderAvatar',
@@ -396,7 +396,7 @@ function SuggestedProfileCard({
}, },
{threshold: 0.5}, {threshold: 0.5},
) )
// @ts-ignore - web only // @ts-expect-error - web only
observer.observe(node) observer.observe(node)
return () => observer.disconnect() return () => observer.disconnect()
} else { } else {
-1
View File
@@ -128,7 +128,6 @@ export const ProfileKnownFollowersScreen = ({route}: Props) => {
onRetry={fetchNextPage} onRetry={fetchNextPage}
/> />
} }
// @ts-ignore our .web version only -prf
desktopFixedHeight desktopFixedHeight
initialNumToRender={initialNumToRender} initialNumToRender={initialNumToRender}
windowSize={11} windowSize={11}
@@ -3,7 +3,6 @@ import {StyleSheet} from 'react-native'
import {type CaptchaWebViewProps} from './CaptchaWebView.shared' import {type CaptchaWebViewProps} from './CaptchaWebView.shared'
// @ts-ignore web only, we will always redirect to the app on web (CORS)
const REDIRECT_HOST = new URL(window.location.href).host const REDIRECT_HOST = new URL(window.location.href).host
export function CaptchaWebView({ export function CaptchaWebView({
@@ -25,13 +24,11 @@ export function CaptchaWebView({
}, [onError]) }, [onError])
const onLoad = useCallback(() => { const onLoad = useCallback(() => {
// @ts-ignore web
const frame: HTMLIFrameElement = document.getElementById( const frame: HTMLIFrameElement = document.getElementById(
'captcha-iframe', 'captcha-iframe',
) as HTMLIFrameElement ) as HTMLIFrameElement
try { try {
// @ts-ignore web
const href = frame?.contentWindow?.location.href const href = frame?.contentWindow?.location.href
if (!href) return if (!href) return
const urlp = new URL(href) const urlp = new URL(href)
-1
View File
@@ -177,7 +177,6 @@ function TopicScreenTab({
onEndReached={onEndReached} onEndReached={onEndReached}
onEndReachedThreshold={4} onEndReachedThreshold={4}
onItemSeen={trackPostView} onItemSeen={trackPostView}
// @ts-ignore web only -prf
desktopFixedHeight desktopFixedHeight
ListFooterComponent={ ListFooterComponent={
<ListFooter <ListFooter
-1
View File
@@ -77,7 +77,6 @@ function useMigrateMutes(setThreadMute: SetStateContext) {
while (!cancelled) { while (!cancelled) {
const threads = persisted.get('mutedThreads') const threads = persisted.get('mutedThreads')
// @ts-ignore findLast is polyfilled - esb
const root = threads.findLast(uri => uri.includes(currentAccount.did)) const root = threads.findLast(uri => uri.includes(currentAccount.did))
if (!root) break if (!root) break
+1 -1
View File
@@ -209,7 +209,7 @@ export function tryParse(rawData: string): Schema | undefined {
const errors = const errors =
parsed.error?.errors?.map(e => ({ parsed.error?.errors?.map(e => ({
code: e.code, code: e.code,
// @ts-ignore exists on some types // @ts-expect-error exists on some types
expected: e?.expected, expected: e?.expected,
path: e.path?.join('.'), path: e.path?.join('.'),
})) || [] })) || []
+1 -1
View File
@@ -45,7 +45,7 @@ export function useNuxs():
// const queryClient = useQueryClient() // const queryClient = useQueryClient()
// const pdsClient = usePdsClient() // const pdsClient = usePdsClient()
// // @ts-ignore // // @ts-expect-error
// window.clearNux = async (ids: string[]) => { // window.clearNux = async (ids: string[]) => {
// await pdsClient.call(removeNuxs, ids) // await pdsClient.call(removeNuxs, ids)
// // triggers a refetch // // triggers a refetch
+3 -3
View File
@@ -90,7 +90,7 @@ export function getTraversalMetadata({
} }
if (isDevMode()) { if (isDevMode()) {
// @ts-ignore dev only for debugging // @ts-expect-error dev only for debugging
metadata.postData.text = getPostRecord(item.value.post).text metadata.postData.text = getPostRecord(item.value.post).text
} }
@@ -104,9 +104,9 @@ export function storeTraversalMetadata(
metadatas.set(metadata.postData.uri, metadata) metadatas.set(metadata.postData.uri, metadata)
if (isDevMode()) { if (isDevMode()) {
// @ts-ignore dev only for debugging // @ts-expect-error dev only for debugging
metadatas.set(metadata.postData.text, metadata) metadatas.set(metadata.postData.text, metadata)
// @ts-ignore // @ts-expect-error
window.__thread = metadatas window.__thread = metadatas
} }
} }
+2 -2
View File
@@ -21,7 +21,7 @@ export function threadPostNoUnauthenticated({
uri, uri,
depth, depth,
value: value as app.bsky.unspecced.defs.ThreadItemNoUnauthenticated, value: value as app.bsky.unspecced.defs.ThreadItemNoUnauthenticated,
// @ts-ignore populated by the traversal // @ts-expect-error populated by the traversal
ui: {}, ui: {},
} }
} }
@@ -91,7 +91,7 @@ export function threadPost({
}, },
isBlurred, isBlurred,
moderation, moderation,
// @ts-ignore populated by the traversal // @ts-expect-error populated by the traversal
ui: {}, ui: {},
} }
} }
+1 -1
View File
@@ -63,7 +63,7 @@ test(`removes multiple keys at once`, () => {
test(`concatenates keys`, () => { test(`concatenates keys`, () => {
store.remove([scope, 'str']) store.remove([scope, 'str'])
store.set([scope, 'str'], 'concat') store.set([scope, 'str'], 'concat')
// @ts-ignore accessing these properties for testing purposes only // @ts-expect-error accessing these properties for testing purposes only
expect(store.store.getString(`${scope}${store.sep}str`)).toBeTruthy() expect(store.store.getString(`${scope}${store.sep}str`)).toBeTruthy()
}) })
+2 -2
View File
@@ -11,9 +11,9 @@ import {Logo} from '#/view/icons/Logo'
import {Logotype} from '#/view/icons/Logotype' import {Logotype} from '#/view/icons/Logotype'
import {atoms as a, useTheme} from '#/alf' import {atoms as a, useTheme} from '#/alf'
import {Button, ButtonText} from '#/components/Button' import {Button, ButtonText} from '#/components/Button'
// @ts-ignore // @ts-expect-error
import splashImagePointer from '../../../../assets/illustrations/illustration-mobile.png' import splashImagePointer from '../../../../assets/illustrations/illustration-mobile.png'
// @ts-ignore // @ts-expect-error
import darkSplashImagePointer from '../../../../assets/illustrations/illustration-mobile-dark.png' import darkSplashImagePointer from '../../../../assets/illustrations/illustration-mobile-dark.png'
const splashImageUri = RNImage.resolveAssetSource(splashImagePointer)!.uri const splashImageUri = RNImage.resolveAssetSource(splashImagePointer)!.uri
const darkSplashImageUri = RNImage.resolveAssetSource( const darkSplashImageUri = RNImage.resolveAssetSource(
@@ -177,7 +177,6 @@ export function TextInput({
* Android impl of `PasteInput` doesn't support the array syntax for `fontVariant` * Android impl of `PasteInput` doesn't support the array syntax for `fontVariant`
*/ */
if (IS_ANDROID) { if (IS_ANDROID) {
// @ts-ignore
style.fontVariant = style.fontVariant =
typeof style.fontVariant === 'string' typeof style.fontVariant === 'string'
? style.fontVariant ? style.fontVariant
@@ -344,7 +344,7 @@ export function TextInput({
return ( return (
<> <>
<View style={[styles.container, hasRightPadding && styles.rightPadding]}> <View style={[styles.container, hasRightPadding && styles.rightPadding]}>
{/* @ts-ignore inputStyle is fine */} {/* @ts-expect-error inputStyle is fine */}
<EditorContent editor={editor} style={inputStyle} /> <EditorContent editor={editor} style={inputStyle} />
</View> </View>
@@ -479,7 +479,7 @@ const styles = StyleSheet.create({
pointerEvents: 'none', pointerEvents: 'none',
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
// @ts-ignore web only -prf // @ts-expect-error web only -prf
position: 'fixed', position: 'fixed',
padding: 16, padding: 16,
top: 0, top: 0,
@@ -488,7 +488,6 @@ const styles = StyleSheet.create({
right: 0, right: 0,
}, },
dropModal: { dropModal: {
// @ts-ignore web only
boxShadow: 'rgba(0, 0, 0, 0.3) 0px 5px 20px', boxShadow: 'rgba(0, 0, 0, 0.3) 0px 5px 20px',
padding: 8, padding: 8,
borderWidth: 1, borderWidth: 1,
@@ -58,7 +58,7 @@ export function createSuggestion({
return return
} }
// @ts-ignore getReferenceClientRect doesnt like that clientRect can return null -prf // @ts-expect-error getReferenceClientRect doesnt like that clientRect can return null -prf
popup = tippy('body', { popup = tippy('body', {
getReferenceClientRect: props.clientRect, getReferenceClientRect: props.clientRect,
appendTo: () => document.body, appendTo: () => document.body,
@@ -78,7 +78,7 @@ export function createSuggestion({
} }
popup?.[0]?.setProps({ popup?.[0]?.setProps({
// @ts-ignore getReferenceClientRect doesnt like that clientRect can return null -prf // @ts-expect-error getReferenceClientRect doesnt like that clientRect can return null -prf
getReferenceClientRect: props.clientRect, getReferenceClientRect: props.clientRect,
}) })
}, },
-1
View File
@@ -135,7 +135,6 @@ export function PostQuotes({uri}: {uri: string}) {
endMessageText={_(msg`That's all, folks!`)} endMessageText={_(msg`That's all, folks!`)}
/> />
} }
// @ts-ignore our .web version only -prf
desktopFixedHeight desktopFixedHeight
initialNumToRender={initialNumToRender} initialNumToRender={initialNumToRender}
windowSize={11} windowSize={11}
@@ -115,7 +115,6 @@ export function PostRepostedBy({uri}: {uri: string}) {
onRetry={fetchNextPage} onRetry={fetchNextPage}
/> />
} }
// @ts-ignore our .web version only -prf
desktopFixedHeight desktopFixedHeight
initialNumToRender={initialNumToRender} initialNumToRender={initialNumToRender}
windowSize={11} windowSize={11}
-1
View File
@@ -276,7 +276,6 @@ const styles = StyleSheet.create({
paddingRight: 15, paddingRight: 15,
paddingBottom: 5, paddingBottom: 5,
paddingLeft: 10, paddingLeft: 10,
// @ts-ignore web only -prf
cursor: 'pointer', cursor: 'pointer',
}, },
layout: { layout: {
@@ -246,7 +246,6 @@ export function ProfileFollowers({name}: {name: string}) {
onRetry={fetchNextPage} onRetry={fetchNextPage}
/> />
} }
// @ts-ignore our .web version only -prf
desktopFixedHeight desktopFixedHeight
initialNumToRender={initialNumToRender} initialNumToRender={initialNumToRender}
windowSize={11} windowSize={11}
-1
View File
@@ -229,7 +229,6 @@ export function ProfileFollows({name}: {name: string}) {
onRetry={fetchNextPage} onRetry={fetchNextPage}
/> />
} }
// @ts-ignore our .web version only -prf
desktopFixedHeight desktopFixedHeight
initialNumToRender={initialNumToRender} initialNumToRender={initialNumToRender}
windowSize={11} windowSize={11}
-1
View File
@@ -22,7 +22,6 @@ export function EventStopper({
<View <View
onStartShouldSetResponder={_ => true} onStartShouldSetResponder={_ => true}
onTouchEnd={stop} onTouchEnd={stop}
// @ts-ignore web only -prf
onClick={stop} onClick={stop}
onKeyDown={onKeyDown ? stop : undefined} onKeyDown={onKeyDown ? stop : undefined}
style={style}> style={style}>
+9 -11
View File
@@ -131,13 +131,13 @@ export const Link = memo(function Link({
onAccessibilityAction?.(e) onAccessibilityAction?.(e)
} }
}} }}
// @ts-ignore web only -sfn // @ts-expect-error web only -sfn
dataSet={dataSet} dataSet={dataSet}
{...props} {...props}
android_ripple={{ android_ripple={{
color: t.atoms.bg_contrast_25.backgroundColor, color: t.atoms.bg_contrast_25.backgroundColor,
}}> }}>
{/* @ts-ignore web only -prf */} {/* @ts-expect-error web only -prf */}
<View style={style} href={anchorHref}> <View style={style} href={anchorHref}>
{children ? children : <Text>{title || 'link'}</Text>} {children ? children : <Text>{title || 'link'}</Text>}
</View> </View>
@@ -156,7 +156,7 @@ export const Link = memo(function Link({
accessibilityRole="link" accessibilityRole="link"
accessibilityLabel={props.accessibilityLabel ?? title} accessibilityLabel={props.accessibilityLabel ?? title}
accessibilityHint={props.accessibilityHint} accessibilityHint={props.accessibilityHint}
// @ts-ignore web only -prf // @ts-expect-error web only -prf
href={anchorHref} href={anchorHref}
dataSet={dataSet} dataSet={dataSet}
{...props}> {...props}>
@@ -281,7 +281,7 @@ export const TextLink = memo(function TextLink({
lineHeight={lineHeight} lineHeight={lineHeight}
dataSet={dataSet} dataSet={dataSet}
title={title} title={title}
// @ts-ignore web only -prf // @ts-expect-error web only -prf
hrefAttrs={hrefAttrs} // hack to get open in new tab to work on safari. without this, safari will open in a new window hrefAttrs={hrefAttrs} // hack to get open in new tab to work on safari. without this, safari will open in a new window
onPress={onPress} onPress={onPress}
accessibilityRole="link" accessibilityRole="link"
@@ -384,12 +384,12 @@ function onPressInner(
) { ) {
let shouldHandle = false let shouldHandle = false
const isLeftClick = const isLeftClick =
// @ts-ignore Web only -prf // @ts-expect-error Web only -prf
Platform.OS === 'web' && (e.button == null || e.button === 0) Platform.OS === 'web' && (e.button == null || e.button === 0)
// @ts-ignore Web only -prf // @ts-expect-error Web only -prf
const isMiddleClick = Platform.OS === 'web' && e.button === 1 const isMiddleClick = Platform.OS === 'web' && e.button === 1
const isMetaKey = const isMetaKey =
// @ts-ignore Web only -prf // @ts-expect-error Web only -prf
Platform.OS === 'web' && (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) Platform.OS === 'web' && (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)
const newTab = isMetaKey || isMiddleClick const newTab = isMetaKey || isMiddleClick
@@ -398,7 +398,7 @@ function onPressInner(
} else if ( } else if (
!e.defaultPrevented && // onPress prevented default !e.defaultPrevented && // onPress prevented default
(isLeftClick || isMiddleClick) && // ignore everything but left and middle clicks (isLeftClick || isMiddleClick) && // ignore everything but left and middle clicks
// @ts-ignore Web only -prf // @ts-expect-error Web only -prf
[undefined, null, '', 'self'].includes(e.currentTarget?.target) // let browser handle "target=_blank" etc. [undefined, null, '', 'self'].includes(e.currentTarget?.target) // let browser handle "target=_blank" etc.
) { ) {
e.preventDefault() e.preventDefault()
@@ -422,10 +422,8 @@ function onPressInner(
} else { } else {
const [routeName, params] = router.matchPath(href) const [routeName, params] = router.matchPath(href)
if (navigationAction === 'push') { if (navigationAction === 'push') {
// @ts-ignore we're not able to type check on this one -prf
navigation.dispatch(StackActions.push(routeName, params)) navigation.dispatch(StackActions.push(routeName, params))
} else if (navigationAction === 'replace') { } else if (navigationAction === 'replace') {
// @ts-ignore we're not able to type check on this one -prf
navigation.dispatch(StackActions.replace(routeName, params)) navigation.dispatch(StackActions.replace(routeName, params))
} else if (navigationAction === 'navigate') { } else if (navigationAction === 'navigate') {
const state = navigation.getState() const state = navigation.getState()
@@ -435,7 +433,7 @@ function onPressInner(
} else { } else {
// note: 'navigate' actually acts the same as 'push' nowadays // note: 'navigate' actually acts the same as 'push' nowadays
// therefore we need to add 'pop' -sfn // therefore we need to add 'pop' -sfn
// @ts-ignore we're not able to type check on this one -prf // @ts-expect-error we're not able to type check on this one -prf
navigation.navigate(routeName, params, {pop: true}) navigation.navigate(routeName, params, {pop: true})
} }
} else { } else {
+4 -5
View File
@@ -119,7 +119,7 @@ function ListImpl<ItemT>(
if (isValidElement(ListHeaderComponent)) { if (isValidElement(ListHeaderComponent)) {
headerComponent = ListHeaderComponent headerComponent = ListHeaderComponent
} else { } else {
// @ts-ignore Nah it's fine. // @ts-expect-error Nah it's fine.
headerComponent = <ListHeaderComponent /> headerComponent = <ListHeaderComponent />
} }
} }
@@ -129,7 +129,7 @@ function ListImpl<ItemT>(
if (isValidElement(ListFooterComponent)) { if (isValidElement(ListFooterComponent)) {
footerComponent = ListFooterComponent footerComponent = ListFooterComponent
} else { } else {
// @ts-ignore Nah it's fine. // @ts-expect-error Nah it's fine.
footerComponent = <ListFooterComponent /> footerComponent = <ListFooterComponent />
} }
} }
@@ -139,7 +139,7 @@ function ListImpl<ItemT>(
if (isValidElement(ListEmptyComponent)) { if (isValidElement(ListEmptyComponent)) {
emptyComponent = ListEmptyComponent emptyComponent = ListEmptyComponent
} else { } else {
// @ts-ignore Nah it's fine. // @ts-expect-error Nah it's fine.
emptyComponent = <ListEmptyComponent /> emptyComponent = <ListEmptyComponent />
} }
} }
@@ -793,11 +793,10 @@ export const List = memo(forwardRef(ListImpl)) as <ItemT>(
const styles = StyleSheet.create({ const styles = StyleSheet.create({
minHeightViewport: { minHeightViewport: {
// @ts-ignore web only
minHeight: '100vh', minHeight: '100vh',
}, },
parentTreeVisibilityDetector: { parentTreeVisibilityDetector: {
// @ts-ignore web only // @ts-expect-error web only
position: 'fixed', position: 'fixed',
top: 0, top: 0,
left: 0, left: 0,
+1 -1
View File
@@ -21,7 +21,7 @@ export function WebAuxClickWrapper({children}: React.PropsWithChildren<{}>) {
if (Platform.OS !== 'web') return children if (Platform.OS !== 'web') return children
return ( return (
// @ts-ignore web only // @ts-expect-error web only
<div onMouseDown={onMouseDown} onMouseUp={onMouseUp}> <div onMouseDown={onMouseDown} onMouseUp={onMouseUp}>
{children} {children}
</div> </div>
+1 -1
View File
@@ -82,7 +82,7 @@ const styles = StyleSheet.create({
borderRadius: 35, borderRadius: 35,
}, },
outer: { outer: {
// @ts-ignore web-only // @ts-expect-error web-only
position: IS_WEB ? 'fixed' : 'absolute', position: IS_WEB ? 'fixed' : 'absolute',
zIndex: 1, zIndex: 1,
cursor: 'pointer', cursor: 'pointer',
@@ -98,7 +98,6 @@ export const LoggedOutLayout = ({
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
flexDirection: 'row', flexDirection: 'row',
// @ts-ignore web only
height: '100vh', height: '100vh',
}, },
side: { side: {
-4
View File
@@ -68,12 +68,8 @@ function Text_DEPRECATED({
applyFonts(flattened, fonts.family) applyFonts(flattened, fonts.family)
// should always be defined on `typography`
// @ts-ignore
if (flattened.fontSize) { if (flattened.fontSize) {
// @ts-ignore
flattened.fontSize = Math.round( flattened.fontSize = Math.round(
// @ts-ignore
flattened.fontSize * fonts.scaleMultiplier, flattened.fontSize * fonts.scaleMultiplier,
) )
} }
+2 -2
View File
@@ -29,7 +29,7 @@ export const Logo = forwardRef(function LogoImpl(props: Props, ref) {
const _fill = gradient const _fill = gradient
? 'url(#sky)' ? 'url(#sky)'
: fill || styles?.color || t.palette.primary_500 : fill || styles?.color || t.palette.primary_500
// @ts-ignore it's fiiiiine // @ts-expect-error it's fiiiiine
const size = parseInt(rest.width || 32, 10) const size = parseInt(rest.width || 32, 10)
const logoVariant = useLogoVariant(allowVariants) const logoVariant = useLogoVariant(allowVariants)
@@ -56,7 +56,7 @@ export const Logo = forwardRef(function LogoImpl(props: Props, ref) {
return ( return (
<Svg <Svg
fill="none" fill="none"
// @ts-ignore it's fiiiiine // @ts-expect-error it's fiiiiine
ref={ref} ref={ref}
viewBox="0 0 64 57" viewBox="0 0 64 57"
{...rest} {...rest}
+1 -1
View File
@@ -9,7 +9,7 @@ export function Logomark({
...rest ...rest
}: {fill?: PathProps['fill']} & SvgProps) { }: {fill?: PathProps['fill']} & SvgProps) {
const pal = usePalette('default') const pal = usePalette('default')
// @ts-ignore it's fiiiiine // @ts-expect-error it's fiiiiine
const size = parseInt(rest.width || 32) const size = parseInt(rest.width || 32)
return ( return (
+1 -1
View File
@@ -9,7 +9,7 @@ export function Logotype({
...rest ...rest
}: {fill?: PathProps['fill']} & SvgProps) { }: {fill?: PathProps['fill']} & SvgProps) {
const pal = usePalette('default') const pal = usePalette('default')
// @ts-ignore it's fiiiiine // @ts-expect-error it's fiiiiine
const size = parseInt(rest.width || 32) const size = parseInt(rest.width || 32)
return ( return (
+2 -2
View File
@@ -1160,10 +1160,10 @@ function MockAccountScreen({
screenDescription={_(msg`profile`)} screenDescription={_(msg`profile`)}
modui={moderation.ui('profileView')}> modui={moderation.ui('profileView')}>
<ProfileHeaderStandard <ProfileHeaderStandard
// @ts-ignore ProfileViewBasic is close enough -prf // @ts-expect-error ProfileViewBasic is close enough -prf
profile={profile} profile={profile}
moderationOpts={moderationOpts} moderationOpts={moderationOpts}
// @ts-ignore ProfileViewBasic is close enough -esb // @ts-expect-error ProfileViewBasic is close enough -esb
descriptionRT={new RichText({text: profile.description as string})} descriptionRT={new RichText({text: profile.description as string})}
/> />
</ScreenHider> </ScreenHider>
+1 -1
View File
@@ -223,7 +223,7 @@ function HomeScreenReady({
{...props} {...props}
testID="homeScreenFeedTabs" testID="homeScreenFeedTabs"
onPressSelected={onPressSelected} onPressSelected={onPressSelected}
// @ts-ignore // @ts-expect-error
feeds={[{displayName: 'Following'}, {displayName: 'Discover'}]} feeds={[{displayName: 'Following'}, {displayName: 'Discover'}]}
/> />
) )
+1 -1
View File
@@ -649,7 +649,7 @@ const styles = StyleSheet.create({
container: { container: {
flexDirection: 'column', flexDirection: 'column',
height: '100%', height: '100%',
// @ts-ignore Web-only. // @ts-expect-error Web-only.
overflowAnchor: 'none', // Fixes jumps when switching tabs while scrolled down. overflowAnchor: 'none', // Fixes jumps when switching tabs while scrolled down.
}, },
loading: { loading: {