-
Notifications
You must be signed in to change notification settings - Fork 35
Refactor type definitions across components to use more specific types #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@hxrshxz is attempting to deploy a commit to the shopstr-eng Team on Vercel. A member of the Team first needs to authorize it. |
🚨 Linting & Formatting ReportESLint found 111 issue(s). Run
…and 108 more. Prettier found formatting issues. Run 🔍 Please fix these before merging. |
- Updated state types for pending payment data and fiat payment options to use more specific types (Record<string, unknown>). - Refactored payment validation functions to improve type safety and clarity. - Enhanced product filtering logic in DisplayProducts component using useCallback for performance optimization. - Improved type definitions in context and cache services for better type safety and clarity. - Added checks for Nostr extension availability in signer classes to prevent runtime errors. - Updated user profile form to handle fiat options more robustly. - Enhanced error handling and type definitions in fetch and helper functions.
2effe87 to
6af926b
Compare
🚨 Linting & Formatting ReportESLint found 111 issue(s). Run
…and 108 more. Prettier found formatting issues. Run 🔍 Please fix these before merging. |
🚨 Linting & Formatting ReportPrettier found formatting issues. Run 🔍 Please fix these before merging. |
There was a problem hiding this 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 PR refactors type definitions across the codebase to improve type safety by replacing any types with more specific TypeScript types. It introduces new interfaces for WebLN and Nostr, creates a ProofEvent interface, and enhances type safety in product, cart, chat, and wallet contexts while fixing React Hook dependencies and memoizing helper functions.
- Replaced
anytypes with specific TypeScript interfaces throughout the codebase - Added WebLNInterface, NostrInterface, and ProofEvent type definitions
- Fixed React Hook dependency arrays and memoized helper functions for performance
- Enhanced type safety in context interfaces and form data handling
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/types/types.ts | Added WebLN, Nostr, and NIP44 interfaces; updated global window declarations |
| utils/timeout.ts | Improved callback return type specificity |
| utils/nostr/signers/ | Enhanced type safety in signer interfaces and implementations |
| utils/nostr/nostr-manager.ts | Fixed timeout type and null check |
| utils/nostr/nostr-helper-functions.ts | Added null safety for Nostr extension usage |
| utils/nostr/fetch-service.ts | Updated ProofEvent type usage |
| utils/nostr/cache-service.ts | Improved ProfileData typing in cache operations |
| utils/keypress-handler.ts | Replaced any with string type for key events |
| utils/context/context.ts | Added ProofEvent interface and improved context typing |
| pages/ | Fixed React Hook dependencies and null safety checks |
| components/ | Enhanced form data validation and type safety throughout |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
🚨 Linting & Formatting ReportPrettier found formatting issues. Run 🔍 Please fix these before merging. |
🚨 Linting & Formatting ReportPrettier found formatting issues. Run 🔍 Please fix these before merging. |
🚨 Linting & Formatting ReportPrettier found formatting issues. Run 🔍 Please fix these before merging. |
🚨 Linting & Formatting ReportPrettier found formatting issues. Run 🔍 Please fix these before merging. |
🚨 Linting & Formatting ReportPrettier found formatting issues. Run 🔍 Please fix these before merging. |
🚨 Linting & Formatting ReportPrettier found formatting issues. Run 🔍 Please fix these before merging. |
🚨 Linting & Formatting ReportPrettier found formatting issues. Run 🔍 Please fix these before merging. |
Description
Resolved or fixed issue
Screenshots (if applicable)
Before
After
Affirmation
For more details on what to include, see:
Bug Report Template
Feature Request Template
Documentation Issue Template
Security Issue Template