lint and typecheck fixes

This commit is contained in:
Oleksii Bulenok
2026-07-30 18:05:34 +02:00
parent c6febb14e8
commit f96c919d3a
16 changed files with 113 additions and 39 deletions
-4
View File
@@ -184,10 +184,6 @@ module.exports = function (_config) {
androidStatusBar: { androidStatusBar: {
barStyle: 'light-content', barStyle: 'light-content',
}, },
// Dark nav bar in light mode is better than light nav bar in dark mode
androidNavigationBar: {
barStyle: 'light-content',
},
android: { android: {
icon: './assets/app-icons/android_icon_default_next.png', icon: './assets/app-icons/android_icon_default_next.png',
adaptiveIcon: { adaptiveIcon: {
+1 -1
View File
@@ -1528,7 +1528,7 @@
}, },
"src/view/com/composer/drafts/state/storage.ts": { "src/view/com/composer/drafts/state/storage.ts": {
"typescript/require-await": { "typescript/require-await": {
"count": 3 "count": 2
} }
}, },
"src/view/com/composer/photos/EditImageDialog.web.tsx": { "src/view/com/composer/photos/EditImageDialog.web.tsx": {
+8
View File
@@ -0,0 +1,8 @@
diff --git a/build/winter/runtime.native.d.ts b/build/winter/runtime.native.d.ts
index 85c4227e4e37003dd3769a590e73a69874de5fac..27bd245675d09b906c2474d4da9efd073dd4f72c 100644
--- a/build/winter/runtime.native.d.ts
+++ b/build/winter/runtime.native.d.ts
@@ -1,3 +1,2 @@
import 'react-native/Libraries/Core/InitializeCore';
-import '../../types';
//# sourceMappingURL=runtime.native.d.ts.map
+26
View File
@@ -0,0 +1,26 @@
# expo
## build/winter/runtime.native.d.ts
Type-check-only change; no runtime impact (only a `.d.ts` is modified).
Expo 57 added `import '../../types'` to `build/winter/runtime.native.d.ts`
(in Expo 54 the file was an empty `export {}`). That pulls
`expo/types/react-native-web.d.ts` into every native type-check pass via the
chain `expo/build/Expo.fx.d.ts -> ./winter -> runtime.native.d.ts ->
expo/types/index.d.ts`.
`react-native-web.d.ts` augments react-native's `TextStyle` with web-only
props, including `cursor?: string`, which conflicts with react-native 0.86's
own `cursor?: CursorValue`. The merged declaration makes `TextStyle` no
longer assignable to `ViewStyle`, which in turn poisons `StyleSheet.create`
inference (values widen to `ViewStyle | TextStyle | ImageStyle`) and produced
~60 errors in `pnpm typecheck:ios` / `typecheck:android`.
The patch drops the `import '../../types'` line so the web-only augmentation
stays out of the native passes, matching Expo 54 behavior. The web pass is
unaffected: it resolves `runtime.d.ts` (not `.native`), which never had this
import.
Can be removed if Expo stops referencing `./react-native-web` from the types
loaded by the native winter runtime, or guards the augmentation to web.
+1
View File
@@ -27,6 +27,7 @@ patchedDependencies:
'expo-modules-core@57.0.7': patches/expo-modules-core@57.0.7.patch 'expo-modules-core@57.0.7': patches/expo-modules-core@57.0.7.patch
'expo-notifications@57.0.7': patches/expo-notifications@57.0.7.patch 'expo-notifications@57.0.7': patches/expo-notifications@57.0.7.patch
'expo-updates@57.0.10': patches/expo-updates@57.0.10.patch 'expo-updates@57.0.10': patches/expo-updates@57.0.10.patch
expo@57.0.8: patches/expo@57.0.8.patch
'react-native-compressor@1.13.0': patches/react-native-compressor@1.13.0.patch 'react-native-compressor@1.13.0': patches/react-native-compressor@1.13.0.patch
'react-native-date-picker@5.0.13': patches/react-native-date-picker@5.0.13.patch 'react-native-date-picker@5.0.13': patches/react-native-date-picker@5.0.13.patch
'react-native-drawer-layout@4.2.3': patches/react-native-drawer-layout@4.2.3.patch 'react-native-drawer-layout@4.2.3': patches/react-native-drawer-layout@4.2.3.patch
+3 -6
View File
@@ -2,7 +2,7 @@ import {lazy, useState} from 'react'
import {View} from 'react-native' import {View} from 'react-native'
// @ts-expect-error missing types // @ts-expect-error missing types
import QRCode from 'react-native-qrcode-styled' import QRCode from 'react-native-qrcode-styled'
import type ViewShot from 'react-native-view-shot' import {type ViewShotRef} from 'react-native-view-shot'
import {type AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api' import {type AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api'
import {Trans} from '@lingui/react/macro' import {Trans} from '@lingui/react/macro'
@@ -14,10 +14,7 @@ import {Text} from '#/components/Typography'
import {IS_WEB} from '#/env' import {IS_WEB} from '#/env'
import * as bsky from '#/types/bsky' import * as bsky from '#/types/bsky'
const LazyViewShot = lazy( const LazyViewShot = lazy(() => import('react-native-view-shot'))
// @ts-expect-error dynamic import
() => import('react-native-view-shot/src/index'),
)
export function QrCode({ export function QrCode({
starterPack, starterPack,
@@ -26,7 +23,7 @@ export function QrCode({
}: { }: {
starterPack: AppBskyGraphDefs.StarterPackView starterPack: AppBskyGraphDefs.StarterPackView
link: string link: string
ref: React.Ref<ViewShot> ref: React.Ref<ViewShotRef>
}) { }) {
const {record} = starterPack const {record} = starterPack
+2 -2
View File
@@ -1,6 +1,6 @@
import {Suspense, useRef, useState} from 'react' import {Suspense, useRef, useState} from 'react'
import {View} from 'react-native' import {View} from 'react-native'
import type ViewShot from 'react-native-view-shot' import {type ViewShotRef} from 'react-native-view-shot'
import {requestPermissionsAsync, saveToLibraryAsync} from 'expo-media-library' import {requestPermissionsAsync, saveToLibraryAsync} from 'expo-media-library'
import * as Sharing from 'expo-sharing' import * as Sharing from 'expo-sharing'
import {type AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api' import {type AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api'
@@ -38,7 +38,7 @@ export function QrCodeDialog({
const [isSaveProcessing, setIsSaveProcessing] = useState(false) const [isSaveProcessing, setIsSaveProcessing] = useState(false)
const [isCopyProcessing, setIsCopyProcessing] = useState(false) const [isCopyProcessing, setIsCopyProcessing] = useState(false)
const ref = useRef<ViewShot>(null) const ref = useRef<ViewShotRef>(null)
const getCanvas = (base64: string): Promise<HTMLCanvasElement> => { const getCanvas = (base64: string): Promise<HTMLCanvasElement> => {
return new Promise(resolve => { return new Promise(resolve => {
@@ -1,6 +1,6 @@
import {Suspense, useRef} from 'react' import {Suspense, useRef} from 'react'
import {Pressable, View} from 'react-native' import {Pressable, View} from 'react-native'
import type ViewShot from 'react-native-view-shot' import {type ViewShotRef} from 'react-native-view-shot'
import {setStringAsync} from 'expo-clipboard' import {setStringAsync} from 'expo-clipboard'
import {requestPermissionsAsync, saveToLibraryAsync} from 'expo-media-library' import {requestPermissionsAsync, saveToLibraryAsync} from 'expo-media-library'
import {useLingui} from '@lingui/react/macro' import {useLingui} from '@lingui/react/macro'
@@ -41,7 +41,7 @@ export function InviteFriendsDialogInner({
const {currentAccount} = useSession() const {currentAccount} = useSession()
const profileQuery = useProfileQuery({did: currentAccount?.did}) const profileQuery = useProfileQuery({did: currentAccount?.did})
const [themeKey, setThemeKey] = useInviteThemeKey() const [themeKey, setThemeKey] = useInviteThemeKey()
const captureRef = useRef<ViewShot>(null) const captureRef = useRef<ViewShotRef>(null)
const theme = getInviteTheme(themeKey) const theme = getInviteTheme(themeKey)
const variant = t.name === 'light' ? theme.light : theme.dark const variant = t.name === 'light' ? theme.light : theme.dark
@@ -2,7 +2,7 @@ import {lazy} from 'react'
import {View} from 'react-native' import {View} from 'react-native'
// @ts-expect-error missing types // @ts-expect-error missing types
import QRCode from 'react-native-qrcode-styled' import QRCode from 'react-native-qrcode-styled'
import type ViewShot from 'react-native-view-shot' import {type ViewShotRef} from 'react-native-view-shot'
import {Image} from 'expo-image' import {Image} from 'expo-image'
import {LinearGradient} from 'expo-linear-gradient' import {LinearGradient} from 'expo-linear-gradient'
@@ -12,10 +12,7 @@ import {hexToRgb, rgbToHex} from '#/alf/util/colorGeneration'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
import {type InviteThemeVariant} from '../themes' import {type InviteThemeVariant} from '../themes'
const LazyViewShot = lazy( const LazyViewShot = lazy(() => import('react-native-view-shot'))
// @ts-expect-error dynamic import
() => import('react-native-view-shot/src/index'),
)
const CARD_WIDTH = 278 const CARD_WIDTH = 278
const CARD_GRADIENT_PADDING = 12 const CARD_GRADIENT_PADDING = 12
@@ -37,7 +34,7 @@ export function ThemedQrCard({
shareUrl: string shareUrl: string
handle: string handle: string
avatarUri?: string avatarUri?: string
captureRef: React.Ref<ViewShot> captureRef: React.Ref<ViewShotRef>
}) { }) {
const t = useTheme() const t = useTheme()
return ( return (
+40 -8
View File
@@ -18,27 +18,42 @@ declare module '*.css'
/* /*
* expo-file-system's declarations build File/Directory on top of * expo-file-system's declarations build File/Directory on top of
* `./ExpoFileSystem`, which remaps to a web shim whose classes are empty. * `./ExpoFileSystem`, which remaps to a web shim whose classes are empty.
* The fully-typed base classes live in ExpoFileSystem.types (no .web * As of SDK 57 the fully-typed base classes live in
* sibling), so mirror the FileSystem.d.ts wrapper classes on top of those. * internal/NativeFileSystem.types (no .web sibling), so mirror the File.d.ts
* and Directory.d.ts wrapper classes on top of those.
*/ */
declare module 'expo-file-system' { declare module 'expo-file-system' {
import { import {
Directory as ExpoFileSystemDirectory, NativeFileSystemDirectory as ExpoFileSystemDirectory,
File as ExpoFileSystemFile, NativeFileSystemFile as ExpoFileSystemFile,
} from 'expo-file-system/build/ExpoFileSystem.types' } from 'expo-file-system/build/internal/NativeFileSystem.types'
export { export {
type DirectoryCreateOptions, type DirectoryCreateOptions,
type DirectoryInfo, type DirectoryInfo,
type DownloadOptions, type DownloadOptions,
EncodingType, EncodingType,
type FileCreateOptions, type FileCreateOptions,
FileHandle, type FileHandle,
type FileInfo, type FileInfo,
type FileWriteOptions, type FileWriteOptions,
type InfoOptions, type InfoOptions,
type PathInfo, type PathInfo,
} from 'expo-file-system/build/ExpoFileSystem.types' } from 'expo-file-system/build/FileSystem.types'
import {type PathInfo as ExpoPathInfo} from 'expo-file-system/build/ExpoFileSystem.types' import {type PathInfo as ExpoPathInfo} from 'expo-file-system/build/FileSystem.types'
import {
type WatchEvent,
type WatchOptions,
type WatchSubscription,
} from 'expo-file-system/build/FileSystemWatcher.types'
import {
type DownloadTask,
type UploadTask,
} from 'expo-file-system/build/NetworkTasks'
import {
type DownloadTaskOptions,
type UploadOptions,
type UploadResult,
} from 'expo-file-system/build/NetworkTasks.types'
import {PathUtilities} from 'expo-file-system/build/pathUtilities' import {PathUtilities} from 'expo-file-system/build/pathUtilities'
export class Paths extends PathUtilities { export class Paths extends PathUtilities {
@@ -59,8 +74,21 @@ declare module 'expo-file-system' {
readableStream(): ReadableStream<Uint8Array<ArrayBuffer>> readableStream(): ReadableStream<Uint8Array<ArrayBuffer>>
writableStream(): WritableStream<Uint8Array<ArrayBufferLike>> writableStream(): WritableStream<Uint8Array<ArrayBufferLike>>
arrayBuffer(): Promise<ArrayBuffer> arrayBuffer(): Promise<ArrayBuffer>
json(): Promise<unknown>
formData(): ReturnType<Response['formData']>
stream(): ReadableStream<Uint8Array<ArrayBuffer>> stream(): ReadableStream<Uint8Array<ArrayBuffer>>
slice(start?: number, end?: number, contentType?: string): Blob slice(start?: number, end?: number, contentType?: string): Blob
upload(url: string, options?: UploadOptions): Promise<UploadResult>
createUploadTask(url: string, options?: UploadOptions): UploadTask
static createDownloadTask(
url: string,
destination: File | Directory,
options?: DownloadTaskOptions,
): DownloadTask
watch(
callback: (event: WatchEvent<File>) => void,
options?: WatchOptions,
): WatchSubscription
} }
export class Directory extends ExpoFileSystemDirectory { export class Directory extends ExpoFileSystemDirectory {
@@ -70,6 +98,10 @@ declare module 'expo-file-system' {
get name(): string get name(): string
createFile(name: string, mimeType: string | null): File createFile(name: string, mimeType: string | null): File
createDirectory(name: string): Directory createDirectory(name: string): Directory
watch(
callback: (event: WatchEvent<File | Directory>) => void,
options?: WatchOptions,
): WatchSubscription
} }
} }
@@ -7,15 +7,12 @@ import {
useRef, useRef,
} from 'react' } from 'react'
import {View} from 'react-native' import {View} from 'react-native'
import type ViewShot from 'react-native-view-shot' import {type ViewShotRef} from 'react-native-view-shot'
import {useAvatar} from '#/screens/Onboarding/StepProfile/index' import {useAvatar} from '#/screens/Onboarding/StepProfile/index'
import {atoms as a} from '#/alf' import {atoms as a} from '#/alf'
const LazyViewShot = lazy( const LazyViewShot = lazy(() => import('react-native-view-shot'))
// @ts-expect-error dynamic import
() => import('react-native-view-shot/src/index'),
)
const SIZE_MULTIPLIER = 5 const SIZE_MULTIPLIER = 5
@@ -28,7 +25,7 @@ export interface PlaceholderCanvasRef {
export const PlaceholderCanvas = forwardRef<PlaceholderCanvasRef, {}>( export const PlaceholderCanvas = forwardRef<PlaceholderCanvasRef, {}>(
function PlaceholderCanvas({}, ref) { function PlaceholderCanvas({}, ref) {
const {avatar} = useAvatar() const {avatar} = useAvatar()
const viewshotRef = useRef<ViewShot>(null) const viewshotRef = useRef<ViewShotRef>(null)
const Icon = avatar.placeholder.component const Icon = avatar.placeholder.component
const styles = useMemo( const styles = useMemo(
+1 -2
View File
@@ -95,8 +95,7 @@ export function StepInfo({
tldtsRef.current = tldts tldtsRef.current = tldts
}) })
// This will get used in the avatar creator a few steps later, so lets preload it now // This will get used in the avatar creator a few steps later, so lets preload it now
// @ts-expect-error - valid path void import('react-native-view-shot')
void import('react-native-view-shot/src/index')
}, []) }, [])
const onNextPress = () => { const onNextPress = () => {
+1 -1
View File
@@ -555,7 +555,7 @@ export const ComposePost = ({
FileSystem.Paths.cache, FileSystem.Paths.cache,
tempFileName, tempFileName,
) )
sourceFile.copy(tempFile) await sourceFile.copy(tempFile)
logger.debug('restoreVideo: copied to temp file', { logger.debug('restoreVideo: copied to temp file', {
source: videoInfo.uri, source: videoInfo.uri,
temp: tempFile.uri, temp: tempFile.uri,
@@ -50,7 +50,7 @@ export async function saveMediaToLocal(
try { try {
const sourceFile = new File(normalizedSource) const sourceFile = new File(normalizedSource)
sourceFile.copy(destFile) await sourceFile.copy(destFile)
// Update cache after successful save // Update cache after successful save
mediaExistsCache.set(localRefPath, true) mediaExistsCache.set(localRefPath, true)
} catch (error) { } catch (error) {
+15
View File
@@ -12,6 +12,21 @@
*/ */
"expo-file-system/legacy": [ "expo-file-system/legacy": [
"./node_modules/expo-file-system/build/legacy/index.d.ts" "./node_modules/expo-file-system/build/legacy/index.d.ts"
],
/*
* Mirrors the root tsconfig mapping (paths does not merge across
* extends): expo-file-system 57's `exports` map blocks the deep type
* imports in src/platform/misc.web-check.d.ts.
*/
"expo-file-system/build/*": ["./node_modules/expo-file-system/build/*"],
/*
* The react-native exports condition resolves to the package's raw
* TypeScript source, whose findNodeHandle usage breaks under the web
* pass. Point it at the compiled declarations, where skipLibCheck
* applies.
*/
"react-native-view-shot": [
"./node_modules/react-native-view-shot/lib/index.d.ts"
] ]
} }
}, },
+6
View File
@@ -9,6 +9,12 @@
"paths": { "paths": {
"#/*": ["./src/*"], "#/*": ["./src/*"],
"crypto": ["./src/platform/crypto.ts"], "crypto": ["./src/platform/crypto.ts"],
/*
* expo-file-system 57 ships an `exports` map without `./build/*`, which
* blocks the deep type imports in src/platform/misc.web-check.d.ts
* under `moduleResolution: "bundler"`. Type-check-only escape hatch.
*/
"expo-file-system/build/*": ["./node_modules/expo-file-system/build/*"],
}, },
"plugins": [ "plugins": [
{ {