Skip to content

Contains minor improvements and code clean-up across several files.#560

Merged
jamespepper81 merged 2 commits into
mainfrom
dev
Feb 23, 2026
Merged

Contains minor improvements and code clean-up across several files.#560
jamespepper81 merged 2 commits into
mainfrom
dev

Conversation

@jamespepper81
Copy link
Copy Markdown
Contributor

This pull request contains minor improvements and code clean-up across several files. The changes focus on clarifying type usage, improving code readability, and removing redundant imports.

Type and import improvements:

  • Changed the declaration of requiredFunctions in wallet-setup.tsx to use a more concise type syntax, improving readability.
  • Cleaned up imports in components/AnimatedNumber.tsx by removing a redundant TextInput import and grouping it with other React Native imports.

Code readability:

  • Added an ESLint directive in receive.tsx to prevent unnecessary dependency warnings in the useEffect hook, clarifying intent for future maintainers.

claude and others added 2 commits February 23, 2026 17:26
All 3,016 TypeScript errors were caused by missing node_modules
(dependencies not installed). After npm install, fixed remaining
lint warnings: duplicate react-native import, Array<T> syntax,
and suppressed intentional useEffect dep.

https://claude.ai/code/session_017rsjCBTqJkzoTRcL7YXthq
refactor: Clean up imports and type annotations
Copilot AI review requested due to automatic review settings February 23, 2026 17:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request attempts to improve code consistency and readability through type syntax updates and import consolidation. However, it introduces an inconsistency in type declaration syntax and adds an ESLint directive without following the established documentation convention.

Changes:

  • Consolidated TextInput import in AnimatedNumber.tsx from a separate line to the main react-native import statement
  • Changed type syntax for requiredFunctions in wallet-setup.tsx from Array<keyof WalletService> to (keyof WalletService)[]
  • Added ESLint directive in receive.tsx to suppress exhaustive-deps warning

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
components/AnimatedNumber.tsx Consolidates TextInput import with other react-native imports for better organization
app/wallet-setup.tsx Changes array type syntax from Array to T[] notation
app/(tabs)/receive.tsx Adds ESLint directive to disable exhaustive-deps rule

Comment thread app/(tabs)/receive.tsx
});
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [currentWallet?.xpub, currentWallet?.addresses?.length]);
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ESLint directive is missing an explanatory comment. According to the codebase convention (see app/(tabs)/send.tsx:253-254 and app/passkeys-security.tsx:38-39), when adding eslint-disable-next-line react-hooks/exhaustive-deps, you should include a comment explaining why dependencies are intentionally omitted. For example, you could add a comment like "// walletService is intentionally omitted as it's stable" on the dependency array line.

Suggested change
}, [currentWallet?.xpub, currentWallet?.addresses?.length]);
}, [currentWallet?.xpub, currentWallet?.addresses?.length]); // walletService and stable setters/callbacks are intentionally omitted to avoid unnecessary refetch loops

Copilot uses AI. Check for mistakes.
Comment thread app/wallet-setup.tsx

// Verify all required functions are available
const requiredFunctions: Array<keyof WalletService> = ['generateMnemonic', 'validateMnemonic', 'createWallet', 'importWallet'];
const requiredFunctions: (keyof WalletService)[] = ['generateMnemonic', 'validateMnemonic', 'createWallet', 'importWallet'];
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change introduces inconsistency with the existing codebase. The file utils/wallet-service-loader.ts:61 uses Array for the same pattern. For consistency, this should remain as Array rather than changing to (keyof WalletService)[]. While both syntaxes are valid TypeScript, consistency across the codebase is important for maintainability.

Suggested change
const requiredFunctions: (keyof WalletService)[] = ['generateMnemonic', 'validateMnemonic', 'createWallet', 'importWallet'];
const requiredFunctions: Array<keyof WalletService> = ['generateMnemonic', 'validateMnemonic', 'createWallet', 'importWallet'];

Copilot uses AI. Check for mistakes.
@jamespepper81 jamespepper81 merged commit 8739057 into main Feb 23, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants