Skip to content

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Oct 3, 2025

…most nullish literals in checkNullishCoalesceOperands"

Co-authored-by: Chiri Vulpes <github@chiri.works>

func (c *Checker) checkNullishCoalesceOperandRight(right *ast.Node) {
binaryExpression := right.Parent
if binaryExpression.Parent != nil && ast.IsBinaryExpression(binaryExpression.Parent) && binaryExpression.Parent.AsBinaryExpression().OperatorToken.Kind == ast.KindQuestionQuestionToken {
Copy link
Member

Choose a reason for hiding this comment

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

Is retaining isNotWithinNullishCoalesceExpression too annoying?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's not like super annoying, but it's a rather straightforward check and it was only used in this single place so I decided to inline it

@jakebailey jakebailey added this pull request to the merge queue Oct 5, 2025
Merged via the queue into microsoft:main with commit ed2d8c9 Oct 5, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants