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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,31 @@

- run: npx turbo run type-check

lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7

- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm

- run: npm ci

- name: Cache turbo
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.job }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-${{ github.job }}-

- run: npx turbo run lint

dependency-audit:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium test

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
name: Dependency Audit
runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/(tabs)/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ export default function CalendarScreen() {
<Text style={[styles.errorText, { color: tokens.fg2 }]}>
{t("calendar.loadError")}
</Text>
<PillButton variant="ghost" onPress={activeRefresh}>
<PillButton variant="ghost" onPress={() => void activeRefresh()}>
{t("common.retry")}
</PillButton>
</View>
Expand Down
8 changes: 4 additions & 4 deletions apps/mobile/app/(tabs)/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ export default function TodayScreen() {
selectedCount,
)}
confirmLabel={t("habits.bulkDeleteConfirm")}
onConfirm={confirmBulkDelete}
onConfirm={() => void confirmBulkDelete()}
variant="danger"
/>

Expand All @@ -1145,7 +1145,7 @@ export default function TodayScreen() {
selectedCount,
)}
confirmLabel={t("habits.bulkLogConfirm")}
onConfirm={confirmBulkLog}
onConfirm={() => void confirmBulkLog()}
variant="success"
/>

Expand All @@ -1158,7 +1158,7 @@ export default function TodayScreen() {
selectedCount,
)}
confirmLabel={t("habits.bulkSkipConfirm")}
onConfirm={confirmBulkSkip}
onConfirm={() => void confirmBulkSkip()}
variant="warning"
/>

Expand All @@ -1171,7 +1171,7 @@ export default function TodayScreen() {
title={t("habits.deleteConfirmTitle")}
description={t("habits.deleteConfirmMessage")}
confirmLabel={t("common.delete")}
onConfirm={confirmHabitDelete}
onConfirm={() => void confirmHabitDelete()}
variant="danger"
/>

Expand Down
6 changes: 3 additions & 3 deletions apps/mobile/app/(tabs)/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTourTarget } from '@/hooks/use-tour-target'
import { useTourScrollContainer } from '@/hooks/use-tour-scroll-container'
import { View, Text, Pressable, StyleSheet, ScrollView } from 'react-native'
import Animated, { FadeInDown, ReduceMotion } from 'react-native-reanimated'
import { useLocalSearchParams, useRouter, type Href } from 'expo-router'
import { useLocalSearchParams, useRouter } from 'expo-router'
import { SafeAreaView } from 'react-native-safe-area-context'
import { useTranslation } from 'react-i18next'
import { useQueryClient } from '@tanstack/react-query'
Expand Down Expand Up @@ -144,7 +144,7 @@ export default function ProfileScreen() {
return
}

router.push(item.route as Href)
router.push(item.route)
},
[profile, router],
)
Expand Down Expand Up @@ -437,7 +437,7 @@ export default function ProfileScreen() {
}}
onFreshStart={() => setShowResetModal(true)}
onDeleteAccount={() => setShowDeleteModal(true)}
onLogout={() => logout()}
onLogout={() => void logout()}
/>
</Animated.View>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export function DeleteAccountModal({
</Text>
</View>
<View style={styles.modalActions}>
<PillButton fullWidth onPress={() => logout()}>
<PillButton fullWidth onPress={() => void logout()}>
{t('profile.logout')}
</PillButton>
</View>
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from 'expo-router'
import { type Theme as NavigationTheme } from 'expo-router/react-navigation'
import { StatusBar } from 'expo-status-bar'
import Constants from 'expo-constants'
import Constants, { AppOwnership } from 'expo-constants'
import { Providers } from '@/lib/providers'
import { useAuthStore } from '@/stores/auth-store'
import { useGamificationProfile } from '@/hooks/use-gamification'
Expand Down Expand Up @@ -84,7 +84,7 @@ import { UpgradeRequiredScreen } from '@/components/upgrade-required-screen'
import { TourProvider } from '@/components/tour/tour-provider'
import { TourOverlay } from '@/components/tour/tour-overlay'

const isExpoGo = Constants.appOwnership === 'expo'
const isExpoGo = Constants.appOwnership === AppOwnership.Expo
const PushPrompt = isExpoGo
? () => null
: lazy(() =>
Expand Down
6 changes: 3 additions & 3 deletions apps/mobile/app/accountability-pair.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export default function AccountabilityPairScreen() {
</Text>
</View>
<PillButton
onPress={handleCheckIn}
onPress={() => void handleCheckIn()}
disabled={checkIn.isPending}
busy={checkIn.isPending}
fullWidth
Expand Down Expand Up @@ -245,7 +245,7 @@ export default function AccountabilityPairScreen() {
</ScrollView>
<View style={styles.sheetFooter}>
<PillButton
onPress={handleSaveHabits}
onPress={() => void handleSaveHabits()}
disabled={editHabitIds.length === 0 || setHabits.isPending}
busy={setHabits.isPending}
fullWidth
Expand All @@ -264,7 +264,7 @@ export default function AccountabilityPairScreen() {
})}
description={t('social.buddies.detail.unpairConfirmBody')}
confirmLabel={t('social.buddies.detail.unpair')}
onConfirm={handleUnpair}
onConfirm={() => void handleUnpair()}
variant="danger"
/>
</SafeAreaView>
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/achievements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default function AchievementsScreen() {
<Text style={[styles.errorText, { color: tokens.fg2 }]}>
{t('common.error')}
</Text>
<PillButton variant="ghost" onPress={() => refetch()}>
<PillButton variant="ghost" onPress={() => void refetch()}>
{t('common.retry')}
</PillButton>
</View>
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/advanced-api-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function useApiKeyManagement({
onSettled: () => {
setRevokingKeyId(null)
if (isOnline) {
queryClient.invalidateQueries({ queryKey: apiKeyKeys.all })
void queryClient.invalidateQueries({ queryKey: apiKeyKeys.all })
}
},
})
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/ai-settings-sections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ export function UserFactsList({
<Text style={[styles.emptyBody, { color: tokens.statusBadText }]}>
{t('profile.facts.factsError')}
</Text>
<PillButton fullWidth onPress={() => factsQuery.refetch()}>
<PillButton fullWidth onPress={() => void factsQuery.refetch()}>
{t('profile.facts.retry')}
</PillButton>
</Animated.View>
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/ai-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function AiSettingsScreen() {
}
},
onSettled: () => {
queryClient.invalidateQueries({ queryKey: habitKeys.summaryPrefix() })
void queryClient.invalidateQueries({ queryKey: habitKeys.summaryPrefix() })
},
})

Expand Down
10 changes: 5 additions & 5 deletions apps/mobile/app/auth-callback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { View, Text, ActivityIndicator, StyleSheet } from 'react-native'
import { TriangleAlert } from 'lucide-react-native'
import * as Linking from 'expo-linking'
import { useLocalSearchParams, useRouter, type Href } from 'expo-router'
import { useLocalSearchParams, useRouter } from 'expo-router'
import { useTranslation } from 'react-i18next'
import {
ApiClientError,
Expand Down Expand Up @@ -121,7 +121,7 @@ export default function AuthCallbackScreen() {
const callbackParams = extractGoogleAuthParams(resolvedCallbackUrl)
if (callbackParams.error === 'access_denied') {
const storedReturnUrl = await consumeStoredAuthReturnUrl()
router.replace((storedReturnUrl ? getSafeReturnUrl(storedReturnUrl) : '/login') as Href)
router.replace(storedReturnUrl ? getSafeReturnUrl(storedReturnUrl) : '/login')
return
}

Expand All @@ -144,7 +144,7 @@ export default function AuthCallbackScreen() {
}

const returnUrl = getSafeReturnUrl(await consumeStoredAuthReturnUrl())
router.replace(returnUrl as Href)
router.replace(returnUrl)
} catch (error: unknown) {
const nextErrorState = resolveCallbackError(error)
setErrorState(nextErrorState)
Expand All @@ -161,7 +161,7 @@ export default function AuthCallbackScreen() {
if (processedRef.current || errorState || callbackUrl || isPendingGoogleAuthSession) return

const timeout = setTimeout(() => {
router.replace('/login' as Href)
router.replace('/login')
}, 250)

return () => {
Expand All @@ -178,7 +178,7 @@ export default function AuthCallbackScreen() {
<TriangleAlert size={34} color={tokens.fg3} strokeWidth={1.8} />
</View>
<Text style={styles.errorTitle}>{errorState.message}</Text>
<PillButton onPress={() => router.replace('/login' as Href)}>
<PillButton onPress={() => router.replace('/login')}>
{t('auth.backToLogin')}
</PillButton>
</>
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/calendar-picker-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function CalendarPickerSection({
{t('calendar.calendars.error')}
</Text>
<Pressable
onPress={() => refetch()}
onPress={() => void refetch()}
accessibilityRole="button"
hitSlop={{ top: 4, bottom: 4, left: 4, right: 4 }}
style={({ pressed }) => [
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/app/calendar-sync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ export default function CalendarSyncScreen() {
isConnecting={isConnecting}
onToggleAutoSync={handleToggleAutoSync}
onSyncNow={handleSyncNow}
onReconnect={handleConnect}
onReconnect={() => void handleConnect()}
/>
) : null}

Expand Down Expand Up @@ -570,7 +570,7 @@ export default function CalendarSyncScreen() {
tokens={tokens}
t={t}
onToggle={toggleEvent}
onDismiss={handleDismissSuggestion}
onDismiss={(suggestionId) => void handleDismissSuggestion(suggestionId)}
/>
))}
{events.length > visibleCount ? (
Expand Down
8 changes: 4 additions & 4 deletions apps/mobile/app/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ export default function LoginScreen() {
canSubmitEmail={canSubmitEmail}
isGoogleLoading={isGoogleLoading}
isOnline={isOnline}
onSendCode={sendCode}
onSignInWithGoogle={signInWithGoogle}
onSendCode={() => void sendCode()}
onSignInWithGoogle={() => void signInWithGoogle()}
onOpenTerms={openTerms}
onOpenPrivacy={openPrivacyPolicy}
tokens={tokens}
Expand All @@ -142,8 +142,8 @@ export default function LoginScreen() {
canResend={canResend}
resendCountdown={resendCountdown}
isOnline={isOnline}
onVerifyCode={verifyCode}
onResendCode={resendCode}
onVerifyCode={() => void verifyCode()}
onResendCode={() => void resendCode()}
onBackToEmail={backToEmail}
shakeOffset={shakeOffset}
tokens={tokens}
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/public-profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default function PublicProfileScreen() {
<View style={styles.shareBlock}>
<PillButton
fullWidth
onPress={shareLink}
onPress={() => void shareLink()}
leading={<Share2 size={18} strokeWidth={1.8} color={tokens.fgOnPrimary} />}
>
{t('profile.publicProfile.link.share')}
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/app/r/[code].tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useMemo } from 'react'
import { View } from 'react-native'
import { useLocalSearchParams, useRouter, type Href } from 'expo-router'
import { useLocalSearchParams, useRouter } from 'expo-router'
import { isValidReferralCode } from '@/lib/auth-flow'
import { createTokensV2 } from '@/lib/theme'
import { useAppTheme } from '@/lib/use-app-theme'
Expand Down Expand Up @@ -30,7 +30,7 @@ export default function ReferralRedirectScreen() {
}

const href = validCode ? `/login?ref=${encodeURIComponent(validCode)}` : '/login'
router.replace(href as Href)
router.replace(href)
}, [params.code, router, isAuthenticated])

return <View style={{ flex: 1, backgroundColor: tokens.bg }} />
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/retrospective.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function RetrospectiveScreen() {
useEffect(() => {
let active = true

AsyncStorage.getItem(cacheKey)
void AsyncStorage.getItem(cacheKey)
.then((value) => {
if (!active) return
if (!value) {
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/social/_components/add-friend-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function AddFriendForm() {
autoCapitalize="none"
autoCorrect={false}
/>
<PillButton onPress={handleSubmit} disabled={!canSubmit} busy={sendRequest.isPending} fullWidth>
<PillButton onPress={() => void handleSubmit()} disabled={!canSubmit} busy={sendRequest.isPending} fullWidth>
{sendRequest.isPending ? t('social.addFriend.sending') : t('social.addFriend.submit')}
</PillButton>
</View>
Expand Down
6 changes: 3 additions & 3 deletions apps/mobile/app/social/_components/buddy-invite-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function BuddyInviteRow({ pair, direction }: Readonly<BuddyInviteRowProps
</Pressable>
<Pressable
accessibilityRole="button"
onPress={handleEnd}
onPress={() => void handleEnd()}
disabled={busy}
hitSlop={{ top: 6, bottom: 6 }}
style={({ pressed }) => [
Expand All @@ -108,7 +108,7 @@ export function BuddyInviteRow({ pair, direction }: Readonly<BuddyInviteRowProps
) : (
<Pressable
accessibilityRole="button"
onPress={handleEnd}
onPress={() => void handleEnd()}
disabled={busy}
hitSlop={{ top: 6, bottom: 6 }}
style={({ pressed }) => [
Expand Down Expand Up @@ -138,7 +138,7 @@ export function BuddyInviteRow({ pair, direction }: Readonly<BuddyInviteRowProps
</Text>
<HabitMultiSelect selectedIds={habitIds} onChange={setHabitIds} />
<PillButton
onPress={handleAccept}
onPress={() => void handleAccept()}
disabled={habitIds.length === 0 || accept.isPending}
busy={accept.isPending}
fullWidth
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/social/_components/buddy-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function BuddyRow({ pair }: Readonly<BuddyRowProps>) {
<Pressable
accessibilityRole="button"
accessibilityLabel={t('social.buddies.checkInAction')}
onPress={handleCheckIn}
onPress={() => void handleCheckIn()}
disabled={checkedInToday || checkIn.isPending}
hitSlop={{ top: 7, bottom: 7 }}
style={({ pressed }) => [
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/social/_components/cheer-composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function CheerComposer({ target, onClose }: Readonly<CheerComposerProps>)
{note.length}/{MAX_NOTE}
</Text>
</View>
<PillButton onPress={handleSend} disabled={sendCheer.isPending} busy={sendCheer.isPending} fullWidth>
<PillButton onPress={() => void handleSend()} disabled={sendCheer.isPending} busy={sendCheer.isPending} fullWidth>
{t('social.cheer.send')}
</PillButton>
</View>
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/app/social/_components/edit-handle-sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function EditHandleSheet({ open, onClose }: Readonly<EditHandleSheetProps
maxLength={20}
autoFocus
returnKeyType="done"
onSubmitEditing={handleSave}
onSubmitEditing={() => void handleSave()}
accessibilityLabel={t('social.editHandle.label')}
testID="edit-handle-input"
/>
Expand All @@ -99,7 +99,7 @@ export function EditHandleSheet({ open, onClose }: Readonly<EditHandleSheetProps
<View style={styles.actions}>
<PillButton
fullWidth
onPress={handleSave}
onPress={() => void handleSave()}
disabled={setHandleMutation.isPending}
busy={setHandleMutation.isPending}
accessibilityLabel={t('common.save')}
Expand Down
Loading
Loading