Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

lint/operators/prefer-coalesce-assign-over-fallback

In the modernize set. Safe fix where types prove it, unsafe otherwise.

What it does

Suggests the null coalescing assignment operator (??=) when the right operand of ?? assigns to the same variable or property as its left operand.

Configuration

[lint.rules]
"operators/prefer-coalesce-assign-over-fallback" = "error"

To skip it in some files or lines, add an override or an ignore comment.

Replaces

More lint/operators rules · Edit this page

Last updated on

Was this page helpful?