require-post-message-target-origin
UnreleasedConfiguration
Require an explicit targetOrigin argument in .postMessage() calls so that
messages can be restricted to an intended origin.
Examples
Incorrect:
Correct:
The rule provides editor suggestions, not automatic fixes. Depending on the
receiver, suggestions use its location.origin, self.location.origin, or
'*'. Choose the intended recipient's origin; a wildcard does not restrict
which origin can receive the message.
Options
This rule has no options.
Limitations
Like upstream, this rule cannot distinguish a window from a Worker,
MessagePort, Client, or BroadcastChannel. Those APIs do not accept a
targetOrigin argument, so enable this rule only where it is appropriate.
The recommended preset explicitly disables this rule, matching upstream. If
you want to enable it, place your rule configuration after the preset.
Computed property access, spread arguments, and optional calls are ignored.
Optional member access, such as window?.postMessage(message), is checked.