Repository: TypeScript
Issue: "This binary expression is never nullish" errors due to the way I format my code
Labels: Bug,Help Wanted

### 🔎 Search Terms

This binary expression is never nullish

### 🕗 Version & Regression Information

- (Pretty confident that) this changed in commit or PR #59217 

### ⏯ Playground Link

https://www.typescriptlang.org/play/?ts=5.6.0-beta#code/KYOwrgtgBACghgJwC4HkBmAROBPKBvAWACgBIAOQEsBzACySQomCgF4oAmKAKi6gAYANMRJYA7iFYduvAIxDSAZTAgEFAM7M2nHh3kicDJpO28AzHqUgNSY9KgAWPRjBqA1rZ0BWecICCAG38sbENNKDEJAB8oS1UNKGjg0ISY5Ws9AP9KWnpGMOc3FOy6UIz-URw1SUykvJTM4tymeQBfYmIAE2AAY39EZm6AeysbKgRBsAAHAC4oACUewYQOgB54ZHRggShwCAAjYAQAbQBdU5TlLrQKEGAOgD4Abk6evoQB4bUbScRUTBxZus-sFnkRiEMRlBrFU2JdgNdbh1hAB6ZFQJAIXBjODgN5QH7IKCDNBQDo4KDXBBfYQAfhpUDGE0mRwJwJwJxRaKQNFAUG6PO67goJO5zGxuMQ+N+RJJZNw6igONwrJlO2oJTy2xxHSgwqhg3RmMVgTVOShP3Ealp9IAFEDNjgAHQNdVNZgAMilG3+uHpjKmR3tPudgUaoROUFmcIRdwAlJz0TyJPyekKRTyGQgcWA8SriaTyQqlV6bPm5aVFSAdXq1AaMbg4Ca5ea4JbrVA7b8HdgQ0EDHVPazu1A-eMA0Hgr3akwI1Gq-CbnGE2hG-49nBBeiDauC7g1BarO3-cyJ06AhVsGoTqCgA

### 💻 Code
```ts
const sets = undefined
	// try granular part of day first
	?? group[partOfDay]
	// then check if the granular part of day is any part of nighttime, and if so try all night spawns
	?? (PartOfDay.AllNighttime & partOfDay ? group[PartOfDay.AllNighttime] : undefined)
	// then check if the granular part of day is any part of daytime, and if so try all day spawns
	?? (PartOfDay.AllDaytime & partOfDay ? group[PartOfDay.AllDaytime] : undefined)
	// fallback to all day spawns
	?? group[PartOfDay.Always];
```

### 🙁 Actual behavior
My codebases have a number of instances of things similar to the above — `undefined` is used to put the actual potential results each on their own line, all formatted the same way. However this no longer works in TS 5.6.0 due to it throwing an error. I think this is an over-eager error message.

### 🙂 Expected behavior

I should be able to format the code how I want to still

### Additional information about the issue
<details>
<summary>Other examples of code in my codebases broken by this</summary>

```ts
let plugs: PlugRaw[] = undefined
	?? (this.state ? refresh.plugs ?? [] : undefined)
	?? this.plugs?.slice()
	?? (!this.plugSetHash ? undefined : (await DestinyPlugSetDefinition.get(this.plugSetHash))?.reusablePlugItems)
	?? (this.plugSetHash ? undefined : (await DeepsightSocketExtendedDefinition.get(this.item?.definition.hash))?.sockets[this.index]?.rewardPlugItems)
	?? [];
```

```ts
Component.create()
	.classes.add(ItemTooltipSourceClasses.ActivityName)
	.text.set(undefined
		?? Display.name(lostSectorDisplay)
		?? Display.name(source.dropTable.displayProperties)
		?? Display.name(activity))
	.appendTo(activityComponent);
```

```ts
.setRefreshMethod(() => undefined
	?? (status === UiStatusType.Cut ? this.human?.getStatusLevel(StatusType.Bleeding) === BleedLevel.Minor : undefined)
	?? (status === StatusType.Bleeding ? this.human?.getStatusLevel(StatusType.Bleeding) === BleedLevel.Major : undefined)
	?? !!this.human?.hasStatus(status as StatusType))
```
</details>

Also, this still works for `true &&` conditions and `false ||` conditions — would be nice if it stayed consistent:
```ts
const inRange = true
	&& gatherTile.x - treasureRange <= treasure.x && gatherTile.x + treasureRange >= treasure.x
	&& gatherTile.y - treasureRange <= treasure.y && gatherTile.y + treasureRange >= treasure.y
	&& executor.z === map.position.z;
```

```ts
const needsAuthView = false
	|| (viewRequiredAuth === "required" && !ProfileManager.isAuthenticated())
	|| (viewRequiredAuth === "spy" && !ProfileManager.get());
```