Do not issue Left side of comma operator is unused and has no side effects
error on (0, expr)
this-removing pattern
#48163
Labels
Bug
A bug in TypeScript
Domain: Error Messages
The issue relates to error messaging
Help Wanted
You can do this
Milestone
Both our and babel's output emits
(0, expr)
in many places to unbind thethis
from the call that's about to be done. Ergo, the0, expr
pattern is not without side-effects, and is, in fact, a very highly used pattern that we probably shouldn't issue an error on. It's probably OK to special-case the literal-zero LHS as a signal to silence the error.The text was updated successfully, but these errors were encountered: