-
-
Notifications
You must be signed in to change notification settings - Fork 721
fix(linter): postmessage is not called on window #14192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(linter): postmessage is not called on window #14192
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a false positive in the require_post_message_target_origin linter rule where it was incorrectly flagging postMessage calls on MessagePort objects, which don't require a targetOrigin argument unlike window.postMessage.
- Adds detection logic to identify MessagePort expressions and exclude them from the linter rule
- Introduces a new helper function
is_message_port_expressionto check for various MessagePort patterns - Updates test cases to verify the fix works for different MessagePort usage patterns
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
crates/oxc_linter/src/rules/unicorn/require_post_message_target_origin.rs
Outdated
Show resolved
Hide resolved
crates/oxc_linter/src/rules/unicorn/require_post_message_target_origin.rs
Outdated
Show resolved
Hide resolved
…t_origin.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Kenzo Wada <79452224+Kenzo-Wada@users.noreply.github.com>
c921d4f to
8057875
Compare
CodSpeed Performance ReportMerging #14192 will not alter performanceComparing Summary
Footnotes
|
fixes: #12026
Hi, oxc team!
I'm new to oxc, so if there are any rules or guidelines I should know about, please let me know.