diff --git a/src/pages/cl/ko/index.tsx b/src/pages/cl/ko/index.tsx index cc2e845f..c5d3da17 100644 --- a/src/pages/cl/ko/index.tsx +++ b/src/pages/cl/ko/index.tsx @@ -36,7 +36,7 @@ interface State { possiblePairings: readonly number[] | null pots: FixedArray potsToDisplay: readonly [readonly Team[] | null, readonly Team[]] - matchups: readonly [Team, Team][] + matchups: readonly (readonly [Team] | readonly [Team, Team])[] } function getState(initialPots: FixedArray): State { @@ -85,17 +85,15 @@ function CLKO({ season, pots: initialPots }: Props) { const groupsContanerRef = useRef(null) - // @ts-expect-error Expected const selectedTeam = matchups.find(m => m.length === 1)?.at(-1) const getPossiblePairings = useCallback( async ( newPots: FixedArray, - newMatchups: readonly (readonly [Team, Team])[], + newMatchups: readonly (readonly [Team] | readonly [Team, Team])[], ) => { const [newGwPot, newRuPot] = newPots const initialGwPot = initialPots[0] - // @ts-expect-error Expected // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain const pickedTeam = newMatchups.find(m => m.length === 1)?.at(-1)! const groups = initialGwPot.map(gw => { diff --git a/src/pages/el/ko/index.tsx b/src/pages/el/ko/index.tsx index ed0ea44b..e32d0cfb 100644 --- a/src/pages/el/ko/index.tsx +++ b/src/pages/el/ko/index.tsx @@ -37,7 +37,7 @@ interface State { possiblePairings: readonly number[] | null pots: FixedArray potsToDisplay: readonly [readonly Team[] | null, readonly Team[]] - matchups: readonly [Team, Team][] + matchups: readonly (readonly [Team] | readonly [Team, Team])[] } function getState( @@ -90,17 +90,15 @@ function ELKO({ season, pots: initialPots }: Props) { const groupsContanerRef = useRef(null) - // @ts-expect-error Expected const selectedTeam = matchups.find(m => m.length === 1)?.at(-1) const getPossiblePairings = useCallback( async ( newPots: FixedArray, - newMatchups: readonly (readonly [Team, Team])[], + newMatchups: readonly (readonly [Team] | readonly [Team, Team])[], ) => { const [newGwPot, newRuPot] = newPots const initialGwPot = initialPots[0] - // @ts-expect-error Expected // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain const pickedTeam = newMatchups.find(m => m.length === 1)?.at(-1)! const groups = initialGwPot.map(gw => { diff --git a/src/ui/MatchupsContainer/Matchup.tsx b/src/ui/MatchupsContainer/Matchup.tsx index d730018e..079d9124 100644 --- a/src/ui/MatchupsContainer/Matchup.tsx +++ b/src/ui/MatchupsContainer/Matchup.tsx @@ -20,7 +20,7 @@ const VersusCell = styled(Content)` ` interface Props { - teams: [Team, Team] | null + teams: readonly [Team, Team] | readonly [Team] | null } function Matchup({ teams }: Props) { diff --git a/src/ui/MatchupsContainer/index.tsx b/src/ui/MatchupsContainer/index.tsx index 5b49bf7c..ea23f68d 100644 --- a/src/ui/MatchupsContainer/index.tsx +++ b/src/ui/MatchupsContainer/index.tsx @@ -14,7 +14,7 @@ const RootTable = styled(Table)` ` interface Props { - matchups: readonly [Team, Team][] + matchups: readonly (readonly [Team] | readonly [Team, Team])[] } const MatchupContainer = forwardRef(({ matchups }: Props, ref: any) => (