Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
9 changes: 8 additions & 1 deletion app/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ module.exports = {
files: ['docs/examples/**/*.ts'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'no-console': 'off',
'no-unused-vars': 'off',
'import/no-unresolved': 'off',
},
Expand All @@ -196,15 +198,20 @@ module.exports = {
project: './tsconfig.test.json',
},
rules: {
// Allow console logging in tests
// Allow console logging and relaxed typing in tests
'no-console': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
// Allow console logging in scripts
files: ['scripts/**/*.cjs', 'scripts/*.cjs'],
rules: {
'no-console': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/mobile-deploy-confirm.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const REGEX_PATTERNS = {
function safeReadFile(filePath, description) {
try {
return fs.readFileSync(filePath, 'utf8');
} catch (error) {
} catch {
console.warn(`Warning: Could not read ${description} at ${filePath}`);
return null;
}
Expand Down Expand Up @@ -91,7 +91,7 @@ function safeExecSync(command, description) {

try {
return execSync(command, { encoding: 'utf8' }).trim();
} catch (error) {
} catch {
console.warn(`Warning: Could not ${description}`);
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/typography/Additional.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { shouldShowAesopRedesign } from '@/hooks/useAesopRedesign';
import { slate400 } from '@/utils/colors';
import { dinot } from '@/utils/fonts';

interface AdditionalProps extends TextProps {}
type AdditionalProps = TextProps;

const Additional = ({ children, style, ...props }: AdditionalProps) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/typography/Caution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { StyleSheet, Text } from 'react-native';
import { slate700 } from '@/utils/colors';
import { dinot } from '@/utils/fonts';

interface CautionProps extends TextProps {}
type CautionProps = TextProps;

const Caution = ({ children, style, ...props }: CautionProps) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/typography/Description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { shouldShowAesopRedesign } from '@/hooks/useAesopRedesign';
import { slate500 } from '@/utils/colors';
import { dinot } from '@/utils/fonts';

interface DescriptionProps extends TextProps {}
type DescriptionProps = TextProps;

const Description = ({ children, style, ...props }: DescriptionProps) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion app/src/hooks/useRecoveryPrompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function useRecoveryPrompts() {
if (shouldPrompt) {
showModal();
}
} catch (error) {
} catch {
// Silently fail to avoid breaking the hook
// If we can't get documents, we shouldn't show the prompt
return;
Expand Down
2 changes: 1 addition & 1 deletion app/src/layouts/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { PropsWithChildren } from 'react';
import React from 'react';
import { SafeAreaProvider } from 'react-native-safe-area-context';

interface ConnectedAppLayoutProps extends PropsWithChildren {}
type ConnectedAppLayoutProps = PropsWithChildren;

export default function ConnectedAppLayout({
children,
Expand Down
2 changes: 1 addition & 1 deletion app/src/layouts/ExpandableBottomLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const TopSection: React.FC<TopSectionProps> = ({
);
};

interface FullSectionProps extends ViewProps {}
type FullSectionProps = ViewProps;
/*
* Rather than using a top and bottom section, this component is te entire thing.
* It leave space for the safe area insets and provides basic padding
Expand Down
17 changes: 8 additions & 9 deletions app/src/layouts/SimpleScrolledTitleLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ import { Title } from '@/components/typography/Title';
import { ExpandableBottomLayout } from '@/layouts/ExpandableBottomLayout';
import { white } from '@/utils/colors';

interface DetailListProps
extends PropsWithChildren<{
title: string;
onDismiss: () => void;
secondaryButtonText?: string;
onSecondaryButtonPress?: () => void;
header?: React.ReactNode;
footer?: React.ReactNode;
}> {}
type DetailListProps = PropsWithChildren<{
title: string;
onDismiss: () => void;
secondaryButtonText?: string;
onSecondaryButtonPress?: () => void;
header?: React.ReactNode;
footer?: React.ReactNode;
}>;

export default function SimpleScrolledTitleLayout({
title,
Expand Down
8 changes: 4 additions & 4 deletions app/src/navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ export const navigationScreens = {
// add last to override other screens
...getAesopScreens(),
};

export type RootStackParamList = StaticParamList<typeof AppNavigation>;

const AppNavigation = createNativeStackNavigator({
id: undefined,
initialRouteName: Platform.OS === 'web' ? 'Home' : 'Splash',
Expand All @@ -50,11 +47,14 @@ const AppNavigation = createNativeStackNavigator({
screens: navigationScreens,
});

export type RootStackParamList = StaticParamList<typeof AppNavigation>;

// Create a ref that we can use to access the navigation state
export const navigationRef = createNavigationContainerRef();
export const navigationRef = createNavigationContainerRef<RootStackParamList>();

declare global {
namespace ReactNavigation {
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface RootParamList extends RootStackParamList {}
}
}
Expand Down
6 changes: 1 addition & 5 deletions app/src/screens/aesop/PassportOnboardingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ import { ExpandableBottomLayout } from '@/layouts/ExpandableBottomLayout';
import { black, slate100, white } from '@/utils/colors';
import { hasAnyValidRegisteredDocument } from '@/utils/proving/validateDocument';

interface PassportOnboardingScreenProps {}

const PassportOnboardingScreen: React.FC<
PassportOnboardingScreenProps
> = ({}) => {
const PassportOnboardingScreen: React.FC = () => {
const handleCameraPress = useHapticNavigation('PassportCamera');
const navigateToLaunch = useHapticNavigation('Launch', {
action: 'cancel',
Expand Down
4 changes: 1 addition & 3 deletions app/src/screens/dev/DevPrivateKeyScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import { unsafe_getPrivateKey } from '@/providers/authProvider';
import { black, slate50, slate200, teal500, white } from '@/utils/colors';
import { confirmTap } from '@/utils/haptic';

interface DevPrivateKeyScreen {}

const DevPrivateKeyScreen: React.FC<DevPrivateKeyScreen> = ({}) => {
const DevPrivateKeyScreen: React.FC = () => {
const [privateKey, setPrivateKey] = useState<string | null>(
'Loading private key…',
);
Expand Down
4 changes: 1 addition & 3 deletions app/src/screens/dev/MockDataScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ import { buttonTap, selectionChange } from '@/utils/haptic';

const { trackEvent } = analytics();

interface MockDataScreenProps {}

const documentTypes = {
mock_passport: 'Passport',
mock_id_card: 'ID Card',
Expand Down Expand Up @@ -244,7 +242,7 @@ const FormSection: React.FC<FormSectionProps> = ({
);
};

const MockDataScreen: React.FC<MockDataScreenProps> = ({}) => {
const MockDataScreen: React.FC = () => {
const navigation = useNavigation();
const [age, setAge] = useState(21);
const [expiryYears, setExpiryYears] = useState(5);
Expand Down
2 changes: 1 addition & 1 deletion app/src/screens/misc/ModalScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface ModalParams extends Record<string, any> {
preventDismiss?: boolean;
}

interface ModalScreenProps extends StaticScreenProps<ModalNavigationParams> {}
type ModalScreenProps = StaticScreenProps<ModalNavigationParams>;

const ModalScreen: React.FC<ModalScreenProps> = ({ route: { params } }) => {
const navigation = useNavigation();
Expand Down
4 changes: 1 addition & 3 deletions app/src/screens/passport/PassportCameraScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ import { dinot } from '@/utils/fonts';
import { hasAnyValidRegisteredDocument } from '@/utils/proving/validateDocument';
import { checkScannedInfo } from '@/utils/utils';

interface PassportNFCScanScreen {}

const { trackEvent } = analytics();

const PassportCameraScreen: React.FC<PassportNFCScanScreen> = ({}) => {
const PassportCameraScreen: React.FC = () => {
const navigation = useNavigation();
const isFocused = useIsFocused();
const store = useUserStore();
Expand Down
4 changes: 1 addition & 3 deletions app/src/screens/passport/PassportNFCScanScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ import { hasAnyValidRegisteredDocument } from '@/utils/proving/validateDocument'

const { trackEvent } = analytics();

interface PassportNFCScanScreenProps {}

const emitter =
Platform.OS === 'android'
? new NativeEventEmitter(NativeModules.nativeModule)
Expand All @@ -73,7 +71,7 @@ type PassportNFCScanRoute = RouteProp<
string
>;

const PassportNFCScanScreen: React.FC<PassportNFCScanScreenProps> = ({}) => {
const PassportNFCScanScreen: React.FC = () => {
const navigation = useNavigation();
const route = useRoute<PassportNFCScanRoute>();
const {
Expand Down
4 changes: 1 addition & 3 deletions app/src/screens/passport/PassportNFCScanScreen.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import { ExpandableBottomLayout } from '@/layouts/ExpandableBottomLayout';
import { black, slate100, white } from '@/utils/colors';
import { hasAnyValidRegisteredDocument } from '@/utils/proving/validateDocument';

interface PassportNFCScanScreenProps {}

const PassportNFCScanScreen: React.FC<PassportNFCScanScreenProps> = ({}) => {
const PassportNFCScanScreen: React.FC = () => {
const navigateToLaunch = useHapticNavigation('Launch', {
action: 'cancel',
});
Expand Down
6 changes: 1 addition & 5 deletions app/src/screens/passport/PassportOnboardingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ import { ExpandableBottomLayout } from '@/layouts/ExpandableBottomLayout';
import { black, slate100, white } from '@/utils/colors';
import { impactLight } from '@/utils/haptic';

interface PassportOnboardingScreenProps {}

const PassportOnboardingScreen: React.FC<
PassportOnboardingScreenProps
> = ({}) => {
const PassportOnboardingScreen: React.FC = () => {
const navigation = useNavigation();
const handleCameraPress = useHapticNavigation('PassportCamera');
const animationRef = useRef<LottieView>(null);
Expand Down
4 changes: 2 additions & 2 deletions app/src/screens/prove/ConfirmBelongingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import {
} from '@/utils/notifications/notificationService';
import { useProvingStore } from '@/utils/proving/provingMachine';

type ConfirmBelongingScreenProps = StaticScreenProps<{}>;
type ConfirmBelongingScreenProps = StaticScreenProps<Record<string, never>>;

const { trackEvent } = analytics();

const ConfirmBelongingScreen: React.FC<ConfirmBelongingScreenProps> = ({}) => {
const ConfirmBelongingScreen: React.FC<ConfirmBelongingScreenProps> = () => {
const navigate = useHapticNavigation('LoadingScreen', {
params: {},
});
Expand Down
4 changes: 1 addition & 3 deletions app/src/screens/prove/ViewFinderScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ import analytics from '@/utils/analytics';
import { black, slate800, white } from '@/utils/colors';
import { parseAndValidateUrlParams } from '@/utils/deeplinks';

interface QRCodeViewFinderScreenProps {}

const { trackEvent } = analytics();

const QRCodeViewFinderScreen: React.FC<QRCodeViewFinderScreenProps> = ({}) => {
const QRCodeViewFinderScreen: React.FC = () => {
const { visible: connectionModalVisible } = useConnectionModal();
const navigation = useNavigation();
const isFocused = useIsFocused();
Expand Down
6 changes: 1 addition & 5 deletions app/src/screens/recovery/AccountRecoveryChoiceScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ import { isUserRegisteredWithAlternativeCSCA } from '@/utils/proving/validateDoc

const { trackEvent } = analytics();

interface AccountRecoveryChoiceScreenProps {}

const AccountRecoveryChoiceScreen: React.FC<
AccountRecoveryChoiceScreenProps
> = ({}) => {
const AccountRecoveryChoiceScreen: React.FC = () => {
const { restoreAccountFromMnemonic } = useAuth();
const [restoring, setRestoring] = useState(false);
const { cloudBackupEnabled, toggleCloudBackupEnabled, biometricsAvailable } =
Expand Down
4 changes: 1 addition & 3 deletions app/src/screens/recovery/AccountRecoveryScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import RestoreAccountSvg from '@/images/icons/restore_account.svg';
import { ExpandableBottomLayout } from '@/layouts/ExpandableBottomLayout';
import { black, slate600, white } from '@/utils/colors';

interface AccountRecoveryScreenProps {}

const AccountRecoveryScreen: React.FC<AccountRecoveryScreenProps> = ({}) => {
const AccountRecoveryScreen: React.FC = () => {
const onRestoreAccountPress = useHapticNavigation('AccountRecoveryChoice');
const onCreateAccountPress = useHapticNavigation('CloudBackupSettings', {
params: {
Expand Down
6 changes: 1 addition & 5 deletions app/src/screens/recovery/RecoverWithPhraseScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ import {
} from '@/utils/colors';
import { isUserRegisteredWithAlternativeCSCA } from '@/utils/proving/validateDocument';

interface RecoverWithPhraseScreenProps {}

const RecoverWithPhraseScreen: React.FC<
RecoverWithPhraseScreenProps
> = ({}) => {
const RecoverWithPhraseScreen: React.FC = () => {
const navigation = useNavigation();
const { restoreAccountFromMnemonic } = useAuth();
const { trackEvent } = analytics();
Expand Down
6 changes: 1 addition & 5 deletions app/src/screens/recovery/SaveRecoveryPhraseScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ import { useSettingStore } from '@/stores/settingStore';
import { STORAGE_NAME } from '@/utils/cloudBackup';
import { black, slate400, white } from '@/utils/colors';

interface SaveRecoveryPhraseScreenProps {}

const SaveRecoveryPhraseScreen: React.FC<
SaveRecoveryPhraseScreenProps
> = ({}) => {
const SaveRecoveryPhraseScreen: React.FC = () => {
const [userHasSeenMnemonic, setUserHasSeenMnemonic] = useState(false);
const { mnemonic, loadMnemonic } = useMnemonic();
const { cloudBackupEnabled } = useSettingStore();
Expand Down
13 changes: 6 additions & 7 deletions app/src/screens/settings/CloudBackupScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ const { trackEvent } = analytics();

type NextScreen = keyof Pick<RootStackParamList, 'SaveRecoveryPhrase'>;

interface CloudBackupScreenProps
extends StaticScreenProps<
| {
nextScreen?: NextScreen;
}
| undefined
> {}
type CloudBackupScreenProps = StaticScreenProps<
| {
nextScreen?: NextScreen;
}
| undefined
>;

const CloudBackupScreen: React.FC<CloudBackupScreenProps> = ({
route: { params },
Expand Down
4 changes: 1 addition & 3 deletions app/src/screens/settings/ManageDocumentsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ import { impactLight } from '@/utils/haptic';

const { trackEvent } = analytics();

interface ManageDocumentsScreenProps {}

const PassportDataSelector = () => {
const {
loadDocumentCatalog,
Expand Down Expand Up @@ -265,7 +263,7 @@ const PassportDataSelector = () => {
);
};

const ManageDocumentsScreen: React.FC<ManageDocumentsScreenProps> = ({}) => {
const ManageDocumentsScreen: React.FC = () => {
const navigation =
useNavigation<NativeStackNavigationProp<RootStackParamList>>();
const { bottom } = useSafeAreaInsets();
Expand Down
4 changes: 1 addition & 3 deletions app/src/screens/settings/PassportDataInfoScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ const InfoRow: React.FC<{
</YStack>
);

interface PassportDataInfoScreenProps {}

const PassportDataInfoScreen: React.FC<PassportDataInfoScreenProps> = ({}) => {
const PassportDataInfoScreen: React.FC = () => {
const { getData } = usePassport();
const [metadata, setMetadata] = useState<PassportMetadata | null>(null);
const { bottom } = useSafeAreaInsets();
Expand Down
Loading
Loading