feat: add husky pre-commit and push checks#423
Merged
ECWireless merged 3 commits intomainfrom Dec 3, 2025
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces husky-based Git hooks for automated code quality enforcement and systematically improves type safety across the codebase by replacing any types with explicit TypeScript definitions. The changes primarily focus on transaction handling, table rendering, and contract interactions while migrating some utility functions from ethers.js to viem.
Key Changes:
- Added pre-commit hooks (format check, lint) and pre-push hooks (type check) using husky v9.1.7
- Replaced
anytypes with explicit type definitions in transaction dialogs, tables, state management, and GraphQL query results - Migrated
parseEtherutility from ethers.js to viem in delegation components (partial migration)
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| .husky/pre-commit | Adds git hook to run format checks and linting before commits |
| .husky/pre-push | Adds git hook to run type checking before pushes |
| package.json | Adds husky dependency, typecheck script, and prepare script for hook setup |
| pnpm-lock.yaml | Updates lockfile with husky dependency and transitive dependency resolutions |
| components/Table/index.tsx | Replaces any types with explicit react-table types using HeaderGroup and generic constraints |
| components/TxConfirmedDialog/index.tsx | Adds guard checks for inputData and improves type safety for transaction properties |
| components/TxStartedDialog/index.tsx | Adds null checks for inputData properties to prevent runtime errors |
| components/PerformanceList/index.tsx | Replaces any with explicit Column type and proper type definitions for sort function |
| components/TransactionsList/index.tsx | Replaces any with object[] for table data |
| components/DelegatingWidget/Delegate.tsx | Migrates parseEther from ethers to viem, uses BigInt for amounts |
| components/DelegatingWidget/Undelegate.tsx | Migrates parseEther from ethers to viem |
| components/DelegatingView/index.tsx | Updates amount handling to use BigInt type |
| components/Approve/index.tsx | Updates MAXIMUM_VALUE_UINT256 to BigInt type |
| components/HistoryView/index.tsx | Replaces array reduce with flatMap for cleaner event merging, removes unnecessary type assertions |
| hooks/useExplorerStore.tsx | Defines InputData type to replace any in transaction state management |
| hooks/useHandleTransaction.tsx | Uses InputData type instead of any for transaction arguments |
| lib/fetchWithRetry.ts | Improves error handling types and AbortSignal type casting |
| lib/earningsTree.tsx | Replaces any[] with Buffer[] types in merkle tree implementation |
| lib/api/polls.ts | Adds explicit PollExtended return type |
| pages/voting/create-poll.tsx | Defines explicit types for proposal and lip data structures |
| pages/voting/[poll].tsx | Replaces any casts with explicit type definitions for vote data |
| pages/transactions.tsx | Uses proper GraphQL query result types for events |
| pages/index.tsx | Uses proper GraphQL query result types for events |
| pages/migrate/delegator/contract-wallet-tool.tsx | Defines explicit type for params state |
| layouts/main.tsx | Improves error handling in banner dismissal, reorders imports |
| components/URLVerificationBanner/index.tsx | Reorders imports for consistency |
| components/Drawer/index.tsx | Reorders imports for consistency |
| components/LlamaswapModal/index.tsx | Simplifies import formatting |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Jipperism
approved these changes
Dec 3, 2025
Collaborator
Jipperism
left a comment
There was a problem hiding this comment.
Nice, I like the updated types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AI Summary
This pull request introduces a series of type safety improvements, dependency updates, and code cleanups across several components, primarily focused on transaction handling, table rendering, and contract interactions. The most significant changes include stricter type usage for contract amounts, migration from
etherstoviemfor utility functions, improved type definitions for tables, and enhanced robustness in transaction dialogs.Type Safety and Contract Interaction Improvements
Approve,DelegatingView,DelegatingWidget/Delegate,Undelegate) to useBigIntfor amounts instead of plain numbers or strings, ensuring better type safety and consistency with blockchain data types. [1] [2] [3]parseEtherimports fromethers/lib/utilstoviemin relevant components, aligning with the preferred library for contract utilities. [1] [2]Table and List Rendering Enhancements
Table,PerformanceList,TransactionsList) to use explicit generic types and improved type definitions fromreact-table, reducing reliance onanyand improving type safety for columns and data. [1] [2] [3] [4] [5]Transaction Dialog Robustness
TxConfirmedDialogto handle missing or undefined transaction input data gracefully, preventing crashes and ensuring correct messaging for bond, unbond, and rebond events. [1] [2] [3] [4] [5] [6]Code Quality and Consistency
.husky/pre-commit,.husky/pre-push) [1] [2]History and Performance List Optimizations
HistoryViewandPerformanceListfor more concise and type-safe operations, improving performance and reliability. [1] [2] [3] [4] [5] [6]Let me know if you'd like to review any specific change or need help understanding how these improvements affect the codebase!