-
-
Notifications
You must be signed in to change notification settings - Fork 721
Closed
Labels
A-linterArea - LinterArea - Linter
Description
What version of Oxlint are you using?
0.16.3
What command did you run?
oxlint -D suspicious
What does your .oxlintrc.json config file look like?
Not using a config file.
What happened?
When running on the code of a VSCode extension, it warned me that the .postMessage are missing the targetOrigin argument:
× eslint-plugin-unicorn(require-post-message-target-origin): Missing the `targetOrigin` argument.
╭─[src/vscode/overview-view.ts:35:45]
34 │ if (this._view) {
35 │ this._view.webview.postMessage(message);
· ─
36 │ }
╰────
help: Insert `, self.location.origin`
While this is true in the browser, for window.postMessage, it is not the case for VSCode's webview .postMessage (see https://code.visualstudio.com/api/references/vscode-api#Webview) which only takes a message argument.
I would expect the linter to infer the correct signature and not warn here.
Metadata
Metadata
Assignees
Labels
A-linterArea - LinterArea - Linter