Skip to content

Commit b38338a

Browse files
committed
fix(linter): make require post message target origin a fixer a suggestion (#10754)
from #10439 previously, the below fixer fixed the code ``` export function getPostMessage(port: MessagePort): <T>(message: T) => void { - return <T>(message: T) => port.postMessage(message); + return <T>(message: T) => port.postMessage(message, port.location.origin); } ``` which is unsafe since `MessagePort` does not have that type signature.
1 parent 050ecd9 commit b38338a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/oxc_linter/src/rules/unicorn/require_post_message_target_origin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ declare_oxc_lint!(
4141
RequirePostMessageTargetOrigin,
4242
unicorn,
4343
suspicious,
44-
fix
44+
suggestion
4545
);
4646

4747
impl Rule for RequirePostMessageTargetOrigin {
@@ -75,7 +75,7 @@ impl Rule for RequirePostMessageTargetOrigin {
7575
Span::new(arg.span().end, call_expr.span.end).source_text(ctx.source_text()).find(',');
7676
let offset = comma_idx.unwrap_or(0) as u32;
7777
let target_span = Span::new(arg.span().end + offset, call_expr.span.end);
78-
ctx.diagnostic_with_fix(
78+
ctx.diagnostic_with_suggestion(
7979
require_post_message_target_origin_diagnostic(target_span),
8080
|fixer| {
8181
let last_token = Span::new(call_expr.span.end - 1, call_expr.span.end);

0 commit comments

Comments
 (0)