Fix no-non-null-assertion lint errors in isScoring Map lookups
Replace Map.has(key) ? Map.get(key)! : fallback pattern with Map.get(key) ?? fallback to satisfy oxlint no-non-null-assertion rule. https://claude.ai/code/session_01D3NbnVQdaH82Fk7Jm8y3sB
This commit is contained in:
parent
8d4b1eb238
commit
309381e43b
1 changed files with 2 additions and 4 deletions
|
|
@ -418,7 +418,7 @@ export async function action({ request, params }: Route.ActionArgs) {
|
||||||
round: match.round,
|
round: match.round,
|
||||||
winnerId,
|
winnerId,
|
||||||
loserId,
|
loserId,
|
||||||
isScoring: roundIsScoring.has(match.round) ? roundIsScoring.get(match.round)! : (match.isScoring ?? true),
|
isScoring: roundIsScoring.get(match.round) ?? (match.isScoring ?? true),
|
||||||
sportsSeasonId: event.sportsSeasonId,
|
sportsSeasonId: event.sportsSeasonId,
|
||||||
bracketTemplateId: event.bracketTemplateId,
|
bracketTemplateId: event.bracketTemplateId,
|
||||||
eventName: event.name ?? undefined,
|
eventName: event.name ?? undefined,
|
||||||
|
|
@ -619,9 +619,7 @@ export async function action({ request, params }: Route.ActionArgs) {
|
||||||
// defaults to true, so legacy play-in rows that predate the column are
|
// defaults to true, so legacy play-in rows that predate the column are
|
||||||
// incorrectly marked as scoring and would assign finalPosition=0 to losers
|
// incorrectly marked as scoring and would assign finalPosition=0 to losers
|
||||||
// who still have a second game (e.g. NBA 7v8 play-in loser → Round 2).
|
// who still have a second game (e.g. NBA 7v8 play-in loser → Round 2).
|
||||||
const isScoring = templateRoundIsScoring.has(match.round)
|
const isScoring = templateRoundIsScoring.get(match.round) ?? (match.isScoring ?? true);
|
||||||
? templateRoundIsScoring.get(match.round)!
|
|
||||||
: (match.isScoring ?? true);
|
|
||||||
await processMatchResult(
|
await processMatchResult(
|
||||||
{
|
{
|
||||||
round: match.round,
|
round: match.round,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue