Skip to content

Conversation

@WA11AX
Copy link
Owner

@WA11AX WA11AX commented Aug 13, 2025

Summary

  • replace loose any usages in shared types with generics and unknown
  • add TournamentFormData interface to admin page and update handlers

Testing

  • npm run lint
  • npm run type-check
  • npm test

https://chatgpt.com/codex/tasks/task_e_689c18221e1c8327b7e52cf07076783c

Copilot AI review requested due to automatic review settings August 13, 2025 04:52
Copy link
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 PR refactors TypeScript types by replacing loose any type usages with more specific types like unknown and generics to improve type safety. It also adds proper typing to the admin page's tournament form data handling.

  • Replaces any with unknown in shared type interfaces for better type safety
  • Adds TournamentFormData interface for proper form data typing in admin page
  • Updates function call to match corrected function signature

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
shared/types.ts Replaces any with unknown in generic types and interface properties
client/src/pages/admin.tsx Adds TournamentFormData interface and updates form data typing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

export interface TournamentUpdateMessage {
export interface TournamentUpdateMessage<T = unknown> {
tournamentId: string;
type: "participant_joined" | "participant_left" | "status_changed" | "prize_updated";
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

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

Adding a generic parameter to TournamentUpdateMessage is a breaking change that could affect existing code using this interface. Consider maintaining backward compatibility by creating a new interface or using a union type approach.

Suggested change
type: "participant_joined" | "participant_left" | "status_changed" | "prize_updated";
// Non-generic version for backward compatibility
export interface TournamentUpdateMessage {
tournamentId: string;
type: "participant_joined" | "participant_left" | "status_changed" | "prize_updated";
data: any;
}
// Generic version for new usage
export interface TournamentUpdateMessageGeneric<T = unknown> {
tournamentId: string;
type: "participant_joined" | "participant_left" | "status_changed" | "prize_updated";

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants