From 014f83cabd21c298745d1fae89d1ba4ecb767817 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Tue, 16 Jul 2024 16:44:45 -0700 Subject: [PATCH] fix: remove unused `??` in `getNextMonth` (#2275) Remove unhittable `??` in `getNextMonth.ts` Found by https://github.com/microsoft/TypeScript/pull/59217. `numberOfMonths` can't be `undefined` (it's defaulted to `1` at declaration), and `monthsDiff < numberOfMonths ?? 1` is a syntactic mistake anyway (it parses as `(m < n) ?? 1`, not `m < (n ?? 1)` Co-authored-by: Giampaolo Bellavite --- src/helpers/getNextMonth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/getNextMonth.ts b/src/helpers/getNextMonth.ts index 2ed409272..7bf68d682 100644 --- a/src/helpers/getNextMonth.ts +++ b/src/helpers/getNextMonth.ts @@ -35,7 +35,7 @@ export function getNextMonth( firstDisplayedMonth ); - if (monthsDiff < numberOfMonths ?? 1) { + if (monthsDiff < numberOfMonths) { return undefined; }