added lint and build checks#10
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request refactors the stock search logic in finnhub.actions.ts to improve type safety and data handling, updates SearchCommand and NavItems to handle optional initial stocks, and refactors the authentication initialization. Key feedback includes addressing a regression where the user's bio is hardcoded to an empty string and resolving a duplicate definition of SearchCommandProps in the global types file.
| renderAs?: 'button' | 'text'; | ||
| label?: string; | ||
| initialStocks: StockWithWatchlistStatus[]; | ||
| initialStocks?: StockWithWatchlistStatus[]; |
There was a problem hiding this comment.
The SearchCommandProps type is defined twice in this file (here at line 58 and again at line 171) with conflicting properties. This causes ambiguity in the global scope and can lead to type-checking issues in components using this type. You should consolidate these into a single definition that includes all necessary properties.
| email: session.user.email, | ||
| image: session.user.image || "", | ||
| bio: session.user.bio || "", | ||
| bio: "", |
There was a problem hiding this comment.
Hardcoding bio to an empty string appears to be a workaround for a TypeScript error (likely because bio is missing from the User type definition). This is a regression in functionality if the user's bio was previously being correctly retrieved from the session. A better approach is to extend the User type in types/global.d.ts to include the bio field and ensure it is correctly handled in the authentication schema.
| bio: "", | |
| bio: session.user.bio || "", |
No description provided.