drop the casts the dual-world layer needed
With every producer on the generated lexicons, the branded-string assertions at these 30 sites are no-ops, and oxlint flags them. Also sorts the imports the type flip disturbed and prunes the suppressions that no longer occur. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {type Client, type XrpcRequestParams} from '@atproto/lex'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {app} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {type FeedAPI, type FeedAPIResponse} from './types'
|
||||
|
||||
type GetAuthorFeedParams = XrpcRequestParams<
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {type Client} from '@atproto/lex'
|
||||
|
||||
import {app} from '#/lexicons'
|
||||
import {DEMO_FEED} from '#/lib/demo'
|
||||
import {app} from '#/lexicons'
|
||||
import {type FeedAPI, type FeedAPIResponse} from './types'
|
||||
|
||||
export class DemoFeedAPI implements FeedAPI {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {type Client} from '@atproto/lex'
|
||||
import {type AtUriString} from '@atproto/syntax'
|
||||
|
||||
import {app} from '#/lexicons'
|
||||
import {PROD_DEFAULT_FEED} from '#/lib/constants'
|
||||
import {app} from '#/lexicons'
|
||||
import {CustomFeedAPI} from './custom'
|
||||
import {FollowingFeedAPI} from './following'
|
||||
import {type FeedAPI, type FeedAPIResponse} from './types'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {app} from '#/lexicons'
|
||||
import {type app} from '#/lexicons'
|
||||
|
||||
export interface FeedAPIResponse {
|
||||
cursor?: string
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
|
||||
import {BSKY_FEED_OWNER_DIDS} from '#/lib/constants'
|
||||
import {type UsePreferencesQueryResponse} from '#/state/queries/preferences'
|
||||
import {IS_WEB} from '#/env'
|
||||
|
||||
@@ -312,7 +312,7 @@ async function resolveEmbed(
|
||||
* unbranded strings. Assert at the boundary until it moves to the
|
||||
* clients.
|
||||
*/
|
||||
record: resolvedLink.record as com.atproto.repo.strongRef.Main,
|
||||
record: resolvedLink.record,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -474,9 +474,7 @@ async function resolveMedia(
|
||||
title: resolvedLink.title,
|
||||
description: resolvedLink.description,
|
||||
thumb: blob,
|
||||
associatedRefs: resolvedLink.associatedRefs as
|
||||
| com.atproto.repo.strongRef.Main[]
|
||||
| undefined,
|
||||
associatedRefs: resolvedLink.associatedRefs,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -511,5 +509,5 @@ async function resolveRecord(
|
||||
if (resolvedLink.type !== 'record') {
|
||||
throw Error(t`Expected uri to resolve to a record`)
|
||||
}
|
||||
return resolvedLink.record as com.atproto.repo.strongRef.Main
|
||||
return resolvedLink.record
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ import {type Insets, Platform} from 'react-native'
|
||||
import {type Service} from '@atproto/lex'
|
||||
import {api} from '@bsky.app/sdk'
|
||||
|
||||
import {app} from '#/lexicons'
|
||||
import {BLUESKY_PROXY_DID, CHAT_PROXY_DID, IS_DEV} from '#/env'
|
||||
import {app} from '#/lexicons'
|
||||
|
||||
export const LOCAL_DEV_SERVICE =
|
||||
Platform.OS === 'android' ? 'http://10.0.2.2:2583' : 'http://localhost:2583'
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import {useEffect} from 'react'
|
||||
import * as Notifications from 'expo-notifications'
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {useLingui} from '@lingui/react/macro'
|
||||
import {CommonActions, useNavigation} from '@react-navigation/native'
|
||||
import {useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {useAccountSwitcher} from '#/lib/hooks/useAccountSwitcher'
|
||||
import {logger as notyLogger} from '#/lib/notifications/util'
|
||||
import {type NavigationProp} from '#/lib/routes/types'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {useCallback, useRef} from 'react'
|
||||
|
||||
import {app} from '#/lexicons'
|
||||
import {type Metrics, useAnalytics} from '#/analytics'
|
||||
import {app} from '#/lexicons'
|
||||
|
||||
/**
|
||||
* Hook that returns a callback to track post:view events.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {app} from '#/lexicons'
|
||||
import {LINK_META_PROXY} from '#/lib/constants'
|
||||
import {getGiphyMetaUri} from '#/lib/strings/embed-player'
|
||||
import {parseStarterPackUri} from '#/lib/strings/starter-pack'
|
||||
import {app} from '#/lexicons'
|
||||
import {isBskyAppUrl} from '../strings/url-helpers'
|
||||
|
||||
export enum LikelyType {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {type AppModerationCause} from '#/components/Pills'
|
||||
import {type app, com} from '#/lexicons'
|
||||
import {type app, type com} from '#/lexicons'
|
||||
|
||||
export const ADULT_CONTENT_LABELS = ['sexual', 'nudity', 'porn'] as const
|
||||
export const OTHER_SELF_LABELS = ['graphic-media'] as const
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
useGlobalLabelStrings,
|
||||
} from '#/lib/moderation/useGlobalLabelStrings'
|
||||
import {useLabelDefinitions} from '#/state/preferences'
|
||||
import {type app, com} from '#/lexicons'
|
||||
import {type app, type com} from '#/lexicons'
|
||||
|
||||
export interface LabelInfo {
|
||||
label: com.atproto.label.defs.Label
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {app} from '#/lexicons'
|
||||
|
||||
import {isInvalidHandle} from '#/lib/strings/handles'
|
||||
import {app} from '#/lexicons'
|
||||
|
||||
export function makeProfileLink(
|
||||
info: {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
|
||||
import type * as bsky from '#/types/bsky'
|
||||
|
||||
export function createStarterPackLinkFromAndroidReferrer(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {parse} from 'psl'
|
||||
import TLDs from 'tlds'
|
||||
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {BSKY_SERVICE} from '#/lib/constants'
|
||||
import {isInvalidHandle} from '#/lib/strings/handles'
|
||||
import {startUriToStarterPackUri} from '#/lib/strings/starter-pack'
|
||||
|
||||
Reference in New Issue
Block a user